Re: Making Cocoa Application Scriptable
Re: Making Cocoa Application Scriptable
- Subject: Re: Making Cocoa Application Scriptable
- From: David Phillip Oster <email@hidden>
- Date: Sat, 19 Aug 2006 06:48:20 -0700
At Sat, 19 Aug 2006 07:55:13 -0400, Andrei Tchijov <email@hidden> wrote:
Hi,
I think I am missing something very important, but I can not see
what. I am trying to make my application AppleScript Scriptable. I
was under impression that once you created proper *.scriptSuite and
*.scriptTerminology you should be able to see it in your app
dictionary in Script Editor. I can not. Below are MyApp.scriptSuite/
scriptTerminology. I reduced it to single class NSApplication with
single attribute and it still does not work. Can someone please take
a look and tell me what am I doing wrong:
Your files are malformed. (These days, it is better to write a .sdef
file, and use the tools apple provides to have it generate the
.scriptSuite and .scriptTerminology files.)
Looking at the .scriptTerminology of a working program, I see it
starts (after the <!DOCTYPE>) with
<plist version="1.0">
<dict>
<key>Classes</key>
<dict>
<key>GGAtomEntry</key>
<dict>
<key>Attributes</key>
...
Looking at the .scriptSuite:
<plist version="1.0">
<dict>
<key>AppleEventCode</key>
<string>gcml</string>
<key>Classes</key>
<dict>
<key>GGAtomEntry</key>
<dict>
<key>AppleEventCode</key>
<string>ggae</string>
<key>Attributes</key>
<dict>
...
In your example, you are missing the outer layers of <dict>
Look in /Developer/Examples/Scripting Definitions/ for useful starter
.sdef files. Once a .sdef is part of an Xcode project, Xcode's
contextual menu gives you a choice of opening it as a parsed
appleScript dictionary or as the raw xml as a text file.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden