Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>(I've actually never added scriptability to a Cocoa app, so take my stab in the dark with a grain of salt.)</p> <p>The first thing I would guess is that <code>exposedMethod:</code> takes a parameter, but I don't see where one might be specified in your sdef or AppleScript. In fact, it looks like AppleScript is treating <code>testmethod</code> as a variable, not a command. (Maybe it should be something like "<code>testmethod with ...</code>" instead?) You may need to define a <code>&lt;parameter&gt;</code> or <code>&lt;direct-parameter&gt;</code> element for the command in the sdef.</p> <p>Also, wouldn't you need an object to call the method on? Since your controller is the application delegate, I'm not sure of the intricacies there, but might AppleScript try to invoke <code>testMethod:</code> on NSApplication instead of your delegate?</p> <p>I'm guessing you've looked at Apple's sample code and other resources, but if not, here are a few links that may help:</p> <ul> <li><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/" rel="nofollow noreferrer">Introduction to Cocoa Scripting Guide</a></li> <li><a href="http://developer.apple.com/technotes/tn2002/tn2106.html" rel="nofollow noreferrer">TechNote 2106: Scripting Interface Guidelines</a></li> <li><a href="http://developer.apple.com/samplecode/SimpleScriptingObjects/" rel="nofollow noreferrer">http://developer.apple.com/samplecode/SimpleScriptingObjects/</a></li> <li><a href="http://developer.apple.com/samplecode/SimpleScriptingPlugin/" rel="nofollow noreferrer">http://developer.apple.com/samplecode/SimpleScriptingPlugin/</a></li> <li><a href="http://www.shadowlab.org/softwares/SdefEditor/sdef-format.html" rel="nofollow noreferrer">http://www.shadowlab.org/softwares/SdefEditor/sdef-format.html</a></li> </ul> <p>Good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload