On or about 6/12/09 11:21 AM, thus spake "Vitaly Ovchinnikov" <vitaly.ovchinni...@gmail.com>:
> 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 = m...@tidbits.com, 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com