ApplesauceOS
Read Markdown ↗Download .md

ObjCObject.toString

Read the native object’s description as a JavaScript string.

js
object.toString()

Arguments

No arguments.

Returns

String. String(object) uses the same native description conversion.

Example

js
const text = ObjC.call("NSString", "stringWithString:", "Hello");
try { console.log(String(text)); } // "Hello"
finally { text.release(); }

Notes

This invokes a native method; it can throw for a stale handle or unavailable process. Use toJS() to copy structured Foundation data. object is a returned proxy.

All JavaScript APIs · Automation playbook