Re: Making Cocoa Application Scriptable
Re: Making Cocoa Application Scriptable
- Subject: Re: Making Cocoa Application Scriptable
- From: Matt Neuburg <email@hidden>
- Date: Sat, 19 Aug 2006 09:53:58 -0700
- Thread-topic: Making Cocoa Application Scriptable
Now that we have sdefs, you may find it easier and more dependable to build
your dictionary using Sdef Editor (and you can then, if necessary for
backwards compatibility, do the bulk of the transformation to
scriptSuite/scriptTerminology using sdp). Another thing to watch out for is
this: when editing your app's plist, always use Property List Editor, since
if you edit it as text ("by hand") you will certainly make a mistake, and
there is no warning (things will just mysteriously fail).
Apart from this the only suggestion I have is that you restart your computer
(this does, I think, sometimes help in trying to get Script Editor to open
its eyes).
There are many online tutorials showing you how to get started adding
scriptability to your app, including mine:
<http://www.tidbits.com/matt/scriptability/scriptabilityTutorial.html>
m.
On Sat, 19 Aug 2006 07:55:13 -0400, Andrei Tchijov <email@hidden>
said:
>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:
>
> You help will be highly appreciated,
>
>Andrei Tchijov
>
>P.S. I do have <key>NSAppleScriptEnabled</key><string>YES</string> in
>my plist and MyApp.scriptSuite/scriptTerminology are get copied into
>Contents/Resources folder inside my app.
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
>www.apple.com/DTDs/PropertyList-1.0.dtd">
><plist version="1.0">
><dict>
> <key>Name</key>
> <string>MyApp</string>
> <key>AppleEventCode</key>
> <string>avpn</string>
>
> <key>Classes</key>
> <dict>
> <key>NSApplication</key>
> <dict>
> <key>AppleEventCode</key>
> <string>capp</string>
>
> <key>Superclass</key>
> <string>NSCoreSuite.NSApplication</string>
>
> <key>Attributes</key>
> <dict>
> <key>oneAttribute</key>
> <dict>
> <key>AppleEventCode</key>
> <string>aone</string>
> <key>Type</key>
> <string>NSString</string>
> </dict>
> </dict>
> </dict>
> </dict>
></dict>
></plist>
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
>www.apple.com/DTDs/PropertyList-1.0.dtd">
><plist version="1.0">
><dict>
> <key>Name</key>
> <string>MyApp</string>
> <key>Description</key>
> <string>MyApp Scripting Suite</string>
>
> <key>Classes</key>
> <dict>
> <key>NSApplication</key>
> <dict>
> <key>Name</key>
> <string>application</string>
> <key>PluralName</key>
> <string>applications</string>
> <key>Description</key>
> <string>Top Applicaiton</string>
> <key>Attributes</key>
> <dict>
> <key>oneAttribute</key>
> <dict>
> <key>Name</key>
> <string>oneAttribute</string>
> <key>Description</key>
> <string>one attribute</string>
> </dict>
> </dict>
>
> </dict>
> </dict>
></dict>
></plist>
>
>
>
>
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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