Re: AppleScript bug in cocoa
Re: AppleScript bug in cocoa
- Subject: Re: AppleScript bug in cocoa
- From: Chris Forsythe <email@hidden>
- Date: Tue, 27 Dec 2005 23:35:31 -0600
Shawn Erickson wrote:
On Dec 27, 2005, at 8:35 PM, Jean-Olivier Lanctôt wrote:
<snip>
I'm baffled. I don't know what to do and I depend on AppleScript.
I can't release an app that has this type of behavior.
Have you considered using what NSWorkspace provides for this type of
thing?
For example -launchedApplications[1] and checking for iTunes by name
or likely better by bundle identifier to avoid possible localization
issues (not sure if they come into play here). Also consider
monitoring for iTunes launching be listening for
NSWorkspaceDidLaunchApplicationNotification and
NSWorkspaceDidTerminateApplicationNotification notifications.
I have personally used this to understand if iTunes is running and
then to send it AppleEvents via simple AppleScript run from inside of
a Cocoa application.
I concur, and here you go with some code from GrowlTunes if you'd like
to take a look at:
http://trac.growl.info/trac/browser/tags/growl-0.7.3/Extras/GrowlTunes/GrowlTunesController.m
Look for iTunesIsRunning along with what Shawn said.
Chris
_______________________________________________
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