• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript bug in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >AppleScript bug in cocoa (From: Jean-Olivier Lanctôt <email@hidden>)
 >Re: AppleScript bug in cocoa (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Agent Applications and launchd
  • Next by Date: Re: Agent Applications and launchd
  • Previous by thread: Re: AppleScript bug in cocoa
  • Next by thread: Re: AppleScript bug in cocoa
  • Index(es):
    • Date
    • Thread