• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Making Cocoa Application Scriptable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Cocoa for Dummies book?
  • Next by Date: Show/Hide Toolbar Rendering Bug?
  • Previous by thread: Making Cocoa Application Scriptable
  • Next by thread: Re: Making Cocoa Application Scriptable
  • Index(es):
    • Date
    • Thread