![]() AppleScriptObjC is case-sensitive and much of the terminology is verbose, so it is very easy to make typos. «class ocid» id «data optr00000000C0E0017AFF7F0000»Īnd just when you have your script working, you are likely to get an error saying the script cannot be saved because pointers cannot be stored in scripts. So when you run a script that returns a Cocoa object in a standard script editor, you will see something like this: When these pointers get passed to AppleScript, they get wrapped in a special AppleScript container. ![]() Objective-C scripting deals in pointers - essentially what gets passed around is the address in memory of objects. If that didn’t make debugging difficult enough, there is another catch. But AppleScriptObjC all happens inside AppleScript itself: there are no Apple events, so nothing appears in the event log, other than the final result of any script. There are mechanisms for examining these events and logging them. ![]() Scripting applications involves sending Apple events to them, and dealing with Apple events returned from those applications. With AppleScriptObjC there are some compounding factors, apart from the fact that Objective-C is new territory to most scripters. Like the previous big expansion of abilities - the introduction of do shell script and access to shell commands - it can also involve a significant learning curve. Direct access to the Cocoa frameworks - AppleScriptObjC - has been one of the biggest boosts to AppleScript’s abilities in a long time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |