Implementing AppleScript Recordability
The
ASObj
function creates anASObject
proxy object for any NSObject that implementsobjectSpecifier
.invokeCommand
takes care of marshalling the parameters into an AppleEvent, sending it, and unmarshalling the return value into an NSObject. The name of the command is the name of the name used in AppleScript, not the Cocoa implementation.
Then his controllers use the proxy objects to talk to the model through AppleScript.