Re: Adding scripting support to Cocoa applications
Re: Adding scripting support to Cocoa applications
- Subject: Re: Adding scripting support to Cocoa applications
- From: Chris Hanson <email@hidden>
- Date: Mon, 10 Mar 2003 10:17:20 -0600
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
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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.