Re: AppleScript bug in cocoa
Re: AppleScript bug in cocoa
- Subject: Re: AppleScript bug in cocoa
- From: Matt Neuburg <email@hidden>
- Date: Wed, 28 Dec 2005 05:12:40 -0800
- Thread-topic: AppleScript bug in cocoa
On Tue, 27 Dec 2005 23:35:02 -0500, Jean-Olivier Lanct?t
<email@hidden> said:
>
Hi,
>
>
In my app, I make extensive use of AppleScript (via NSAppleScript) to
>
communicate with iTunes. I have 10 scripts, located inside my
>
resources bundle.
>
>
The problem is that each time my app starts, it starts iTunes up if
>
it's not already running. I consider this to be a bug, since all my
>
apple scripts use this to make sure iTunes does not start up when
>
it's not running....
>
>
if (itunes_is_running())
>
tell application "iTunes"
>
>
...
>
>
end tell
>
end if
That code does not, of itself, "make sure iTunes does not start up when it's
not running". The "if" has no effect upon the matter. If that script is
text, then it needs compiling; and to compile a script that uses iTunes
terminology, AppleScript must start up iTunes (see my book for all the gory
details). That happens before your code runs. So by the time your code runs,
iTunes *is* running. If that's the cause, start with a compiled script
instead. m.
--
matt neuburg, phd = email@hidden, <
http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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