ApplesauceOS
Read Markdown ↗Download .md

waitForApp

Launch an app if necessary and wait for its helper.

js
waitForApp(bundleId, timeout = 12)

Arguments

ArgumentTypeMeaning
bundleIdstringTarget app identifier.
timeoutnumberSeconds; default 12.

Returns

No return value (undefined). Timeout also returns without a success value.

Example

js
waitForApp("com.apple.Preferences", 8);
if (frontMostAppId() !== "com.apple.Preferences") throw new Error("Not foreground");

Notes

Use UIHelper.waitForElement afterward to verify UI readiness.

All JavaScript APIs · Automation playbook