ApplesauceOS
Read Markdown ↗Download .md

UIHelper.waitForGone

Wait until no element matches.

js
ui.waitForGone(selector, optionsOrTimeout?)

Arguments

ArgumentTypeMeaning
selectorobject | stringAttribute filters; a string means {name: string}. See the UIHelper guide for selectors.
optionsOrTimeoutobject | numberOptional milliseconds, or {timeout:5000, interval:100, throwOnTimeout:true}. Interval is at least 10 ms.

Returns

true; throws TimeoutError on timeout, or false with throwOnTimeout:false.

Example

js
const ui = UIHelper.forApp("com.example.app");
ui.waitForGone({id: "loading", visible: true}, 10000);

Notes

Replace example identifiers with selectors verified in your app. Pinning an app does not open it. With visible:true, hiding the element also satisfies the condition. Global shortcuts use the unpinned foreground-app client.

Also available as

waitForGone.

All JavaScript APIs · Automation playbook