ApplesauceOS
Read Markdown ↗Download .md

ObjC.call

Call an exact Objective-C selector.

js
ObjC.call(target, selector, ...args)

Arguments

ArgumentTypeMeaning
targetstring | proxyClass name or object proxy from this client.
selectorstringExact selector, including colons.
argsanyArguments matching the fixed native signature.

Returns

Native scalars become JS primitives; objects/classes remain proxies; nil/void is null. Large integers use BigInt (or a decimal string if unavailable).

Example

js
const text = ObjC.call("NSString", "stringWithString:", "Hello");
console.log(text.toJS());
text.release();

Notes

Start with Objective-C step by step. Also available on app = RemoteObjC.forApp(bundleId) as app.call(). No callbacks, non-null blocks, variadic calls, unions or arbitrary pointers. Use null for nil, not the string "nil".

All JavaScript APIs · Automation playbook