ApplesauceOS
Read Markdown ↗Download .md

RemoteC.forApp

Create or reuse a C client for a running app.

js
RemoteC.forApp(bundleId)

Arguments

ArgumentTypeMeaning
bundleIdstringApp with automation enabled.

Returns

C client sharing the corresponding ObjC session.

Example

js
openApp("com.apple.Preferences");
const app = RemoteC.forApp("com.apple.Preferences");
console.log(app.getInfo());

Notes

Advanced API: the declared types must match the real native function. Wrong signatures/addresses can crash the target. No variadic functions, callbacks or arbitrary custom structures. Calls run on the target main thread. See C functions and memory for types and ownership.

Also available as

C.forApp.

All JavaScript APIs · Automation playbook