• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problems with scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: problems with scripting
      • From: Vitaly Ovchinnikov <email@hidden>
References: 
 >Re: problems with scripting (From: Vitaly Ovchinnikov <email@hidden>)

  • Prev by Date: Re: API for fetching the computer name in cocoa
  • Next by Date: Re: Questions on using using modal sheets with Core Data
  • Previous by thread: Re: problems with scripting
  • Next by thread: Re: problems with scripting
  • Index(es):
    • Date
    • Thread