Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript error - NSCannotCreateScriptCommandError



On Mon, 19 Jul 2004 16:08:56 -0700, Steve Palmer <email@hidden>
said:
>Yes, I'm sure but the breakpoint on the code that returns the tasks
>isn't being hit.
>
>I guess that at this point I really need some better documentation or
>more sample code. Specifically I'd like to know more about how
>AppleScript resolves "set foo to name of current task" where "current
>task" returns a Task object. Same for "set foo to every task".

Well, "current" is meaningless, so "current task" would have to be the name
of some application property (that is, defined by the application as a
property of the application object) that has a name property. Compare:

tell app "iTunes" to get name of current track

which is

core\getd{
----:obj {
form:'prop',
want:'prop',
seld:'pnam',
from:obj {
form:'prop',
want:'prop',
seld:'pTrk',
from:'null'()
}
}
}

(See my book for more on how to read an Apple event in this format.)

But "every" is an element specifier (see my book for the technical details
on what that means). So:

tell app "iTunes" to get every track

is:

core\getd{
----:obj {
form:'indx',
want:'cTrk',
seld:abso($616C6C20$),
from:'null'()
}
}

The "set foo to" is irrelevant, since that is done by AppleScript, not by
the target app. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.