Finally fixed it, thanks to sdp. The problem was with the command code that should has 8 characters. Mine has 4. Now all seems to work.
Thank you. On Sat, Jun 13, 2009 at 8:40 AM, Vitaly Ovchinnikov<vitaly.ovchinni...@gmail.com> wrote: > Yes, I read many of them and the command I created should work, as it > almost similar the one you described in your tutorial. > My suite seems to be correct as the property already works, but the > command still doesn't. Am I wrong with the command/suite or with the > script? > > Thank you. > > On Fri, Jun 12, 2009 at 11:20 PM, Matt Neuburg<m...@tidbits.com> wrote: >> 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