Re: Adding scripting support to Cocoa applications
Re: Adding scripting support to Cocoa applications
- Subject: Re: Adding scripting support to Cocoa applications
- From: email@hidden
- Date: Mon, 10 Mar 2003 09:21:36 -0800 (PST)
On Mon, 10 Mar 2003 09:20:26 -0800 (PST), Chris Hanson wrote:
>
>
At 11:42 PM -0800 3/9/03, Ujwal S. Sathyam wrote:
>
>When I try to instantiate an object of class foo in Applescript with:
>
>
>
>tell application "MyApp"
>
> make new foo at the beginning of foos
>
>end tell
>
>
>
>I get an error: NSCannotCreateScriptCommandError
>
>
Does your script terminology have a class NSApplication corresponding
>
to the application property, with superclass NSApplication?
>
>
And does your NSApplication class have a many-to-many relationship of
>
type "Foo" named "foos" with the same AppleEvent code as your "Foo"
>
class? Having the same AppleEvent code is important; Suite Modeler
>
will show it in blue, indicating that it's a duplicate -- in this
>
case being a duplicate is a *good* thing.
>
>
And finally, does your NSApplication delegate implement
>
-application:delegateHandlesKey: along with a mutable array key for
>
"foos"?
>
>
If you have all of the above, then your script should work.
>
>
-- Chris
>
-- learned some of this the hard way
>
I see. The answer to all of your questions is a big resounding NO, so I guess
that is why it is not working. Where is all this stuff clearly explained, stuff
that is mandatory, and stuff that is optional? Definitely not in Apple's docs
:-(. For example, I had not even heard of the delegate method...
You mention SuiteModeler. I have been looking at it too. Is it worth the 25
bucks? Will it spare me this pain?
Thanks a lot for your tips!
Ujwal
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.