I’ve got a subclass of NSObject that has methods which are called from my main AppDelegate.applescript file. Basically, I want to be able to do the reverse, and call a handler in my AppDelegate.applescript from a method in the .m file of my NSObject subclass.
I found the following posting: http://macscripter.net/viewtopic.php?id=30478 but even just copying and pasting the example from the posting into a new project, results in a crash. Is there a relatively straight-forward way of accomplishing this? Thanks in advance!
Thanks for your quick response! I think for this project, I only need a instance method. I got it working with your examples, though I am getting a warning about method definition not being found. That said, it runs perfectly even with the warning. I assume the warning is because the ‘definition’ for the handler is in AppDelegate.applescript.
Also, I should correct my earlier statement… I do not have a subclass, but rather a category for an existing class.
The warning I get is: Method definition for ‘doThis’ not found.
property parent : class "NSObject"
property window : missing value
property shortcutView : missing value -- LINKED IN IB
property shortcutObject : missing value -- LINKED IN IB TO OBJECT
tell me to activate
display dialog "It worked!"
return current application's NSTerminateNow