The nominally correct list for this would have been applescript-implementors, but whatever.
The others are correct: AppleScript must fetch the terminology of an application to compile a script against it, and applications are allowed to say that their terminology is "dynamic", that is, "launch me and send me a request, and I'll tell you what it is." (Why iTunes is flagged this way is a minor mystery to me; I thought it used to not be.)
I should point out that compiling and executing a short script from raw source, as NSAppleScript requires you to do, is a woefully inefficient use of system resources. It would be much less work for the system if you simply sent the necessary Apple events yourself. However, it's also much *more* work for you to code, and there isn't any easy way to reduce that (yet).
--Chris Nebel
AppleScript and Automator Engineering
On Jul 29, 2005, at 6:01 AM, Alexander von Below wrote:
I am usually a Cocoa coder, and have noted something that seems odd to me: If the following file is compiled by an NSAppleScript object (either explictly or upon first execution), iTunes is launched:
tell application "System Events"
if exists process "iTunes" then
tell application "iTunes"
if player state is playing then
set x to name of current track & " " & artist of current track
return x
else
return "No"
end if
end tell
else
return "No"
end if
end tell
All subsequent executions of the script work as expected (i.e. not launching iTunes if it is not running)
If the script is modified like this:
tell application "System Events"
if exists process "iTunes" then
return "Yes"
else
return "No"
end if
end tell
Everything works as expected again.