ApplesauceOS
Read Markdown ↗Download .md

UIHelper.waitForAll

Wait until every selector has a match.

js
ui.waitForAll(selectors, optionsOrTimeout?)

Arguments

ArgumentTypeMeaning
selectorsarray1..32 selectors; one query per poll.
optionsOrTimeoutobject | numberOptional milliseconds, or {timeout:5000, interval:100, throwOnTimeout:true}. Interval is at least 10 ms.

Returns

Element array in selector order. Matches need not be distinct. Timeout throws, or returns null when disabled.

Example

js
const ui = UIHelper.forApp("com.example.app");
const [title, done] = ui.waitForAll([{id: "title"}, {id: "done", enabled: true}], 5000);
console.log(title.getText());

Notes

Replace example identifiers with selectors verified in your app. Pinning an app does not open it. Global shortcuts use the unpinned foreground-app client.

Also available as

waitForAll.

All JavaScript APIs · Automation playbook