ApplesauceOS
Read Markdown ↗Download .md

UIHelper.forApp

Create a query client pinned to one app.

js
UIHelper.forApp(bundleId)

Arguments

ArgumentTypeMeaning
bundleIdstringNonempty app bundle ID.

Returns

UIHelper client.

Example

js
if (!openApp("com.apple.Preferences")) throw new Error("Open failed");
const ui = UIHelper.forApp("com.apple.Preferences");
console.log(ui.getTree());

Notes

Without forApp(), UIHelper queries the foreground app.

All JavaScript APIs · Automation playbook