ApplesauceOS
Read Markdown ↗Download .md

ObjCObject.get

Read a value through native key-value coding.

js
object.get(key)

Arguments

ArgumentTypeMeaning
keystringNonempty KVC key.

Returns

Native value converted like an ObjC call.

Example

js
const dictionary = ObjC.create("NSMutableDictionary");
let message;
try {
  dictionary.set("message", "Hello");
  message = dictionary.get("message");
  console.log(message.toJS()); // "Hello"
} finally {
  if (message) message.release();
  dictionary.release();
}

Notes

Start with Objective-C step by step. Here, object means a proxy returned by ObjC/RemoteObjC, not a global named ObjCObject. Missing or unsupported KVC keys can throw; this is not ordinary JavaScript property access.

All JavaScript APIs · Automation playbook