Mac:AppleScript: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 18: Line 18:
**Pros: can be maintained at the Gecko-level, allows developers with no knowledge of Obj-C to provide functionality to Applescript
**Pros: can be maintained at the Gecko-level, allows developers with no knowledge of Obj-C to provide functionality to Applescript
**Cons: could have performance implications (given changes to NSApplication), greater chance of problems interacting with Apple's code
**Cons: could have performance implications (given changes to NSApplication), greater chance of problems interacting with Apple's code
'''Other Options'''
*Override [NSScriptCommand executeCommand]: the stack trace below shows the steps that the system takes to execute an Applescript command:
#0  -[NSScriptCommand executeCommand] ()
#1  -[NSScriptingAppleEventHandler handleCommandEvent:withReplyEvent:] ()
#2  -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#3  _NSAppleEventManagerGenericHandler ()
#4  aeDispatchAppleEvent ()
#5  dispatchEventAndSendReply ()
#6  aeProcessAppleEvent ()
#7  AEProcessAppleEvent ()
#8  _DPSNextEvent ()
#9  -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#10 -[NSApplication run] ()
When it hits executeCommand, the Applescript command is of the form:
Intrinsics.get
Direct Parameter: <NSPropertySpecifier: bookmarks>
Receivers: <NSPropertySpecifier: bookmarks>
Arguments: {}
At this point we could use our own handling to execute the command. The one downside to this is that we loose the automatic support (The Standard suite includes commands such as copy, count, create, delete, exists, and move, as well as common object classes such as application, document, and window).


'''Scripting Hierarchy'''
'''Scripting Hierarchy'''
31

edits

Navigation menu