Re: Making Cocoa Application Scriptable
Re: Making Cocoa Application Scriptable
- Subject: Re: Making Cocoa Application Scriptable
- From: Andrei Tchijov <email@hidden>
- Date: Sat, 19 Aug 2006 18:34:03 -0400
Glenn,
Thanks for the tip. With "-valueInFoosWithName:" I observe the very
same behavior as you described. Does it mean, that there is another
"magical" method name pattern with will "whose name is" work? Do you
know where I can find some what complete list of such patterns?
Very Best regards,
Andrei Tchijov
On Aug 19, 2006, at 6:07 PM, glenn andreas wrote:
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