Re: problems with scripting
Re: problems with scripting
- Subject: Re: problems with scripting
- From: Matt Neuburg <email@hidden>
- Date: Fri, 12 Jun 2009 12:20:24 -0700
- Thread-topic: problems with scripting
On or about 6/12/09 11:21 AM, thus spake "Vitaly Ovchinnikov"
<email@hidden>:
> MyDocument is derived from NSDocument and has property sourceFile and method
> - (id) handleDoSomethingScriptCommand: (NSScriptCommand *) cmd
> {NSLog(@"got it"); return nil; }
>
> I wrote a simple script:
> tell application "My App"
> activate
> make new document
> set source of first document to "/some/path/here"
> --tell first document to dosomething
> close first document
> end tell
>
> This works until I remove comments from the line that calls my method.
> I receive an error that there is no variable "dosomething".
> I tried another syntax: "dosomething first document" and received an error
> too.
Have you tried reading one of the many tutorials on how to make your app
scriptable? Mine is here:
http://www.tidbits.com/matt/scriptability/scriptabilityTutorial.html
But there are many others, plus there's more info in my book. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Customizing Leopard, http://tinyurl.com/2t9629
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden