• 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: Making Cocoa Application Scriptable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making Cocoa Application Scriptable


  • Subject: Re: Making Cocoa Application Scriptable
  • From: glenn andreas <email@hidden>
  • Date: Sat, 19 Aug 2006 17:07:35 -0500


On Aug 19, 2006, at 3:40 PM, Andrei Tchijov wrote:

Matt,
Thanks a lot for tutorial link. This tutorial + SDEF they get me going. I am almost happy with end result of this efforts, the only problem is "... whose name is ..." statement. In my application I have "scriptable" variable "profiles". I can do things line "profile x" or "count profiles" or "name of every profile", but when I try to do "profile whose name is "..."", I am getting error that such profile could not be found.
I have not implemented methods like "countOfProfiles" and "objectInProfilesArrayAtIndex" yet. Will these methods help?


You comments will be highly appreciated.

Somehow my code works fine with "foo named "Something"" but not "foo whose name is "Something"". I really don't know why those two are different, though I did implement an "-valueInFoosWithName:" method.


In general it seems like there's a whole bunch of stuff in Cocoa scripting that just works almost for free, and a handful that halfways works with a little effort (because you did some of the work but not all of it, or you did it the wrong way), and then there's a small handful that just plain doesn't work until you stumble on the magic incantation (for example, I was unable to save anything in a variable until I explicitly got the NSScriptClassDescription for a class, even though all the samples and everywhere else I could just use the [containerRef keyClassDescription]).

You absolutely should do:

defaults write NSGlobalDomain NSScriptingDebugLogLevel 1

so you can watch the AppleEvents getting sent back and forth, and how they are formed - it will help give you the details of how things work far better than reading the documentation (since you can see exactly how your app is (mis)behaving).



Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Making Cocoa Application Scriptable
      • From: Andrei Tchijov <email@hidden>
References: 
 >Re: Making Cocoa Application Scriptable (From: Matt Neuburg <email@hidden>)
 >Re: Making Cocoa Application Scriptable (From: Andrei Tchijov <email@hidden>)

  • Prev by Date: Re: How do I know if a file is a symbolic link? Was: system link
  • Next by Date: Re: Cocoa for Dummies book?
  • Previous by thread: Re: Making Cocoa Application Scriptable
  • Next by thread: Re: Making Cocoa Application Scriptable
  • Index(es):
    • Date
    • Thread