Re: How to tell if iTunes is running.

2008-05-24 Thread Mr. Gecko
Thanks I am using this iTunesIsOpen = NO; [iTunesLMenu setTitle: NSLocalizedString(@Launch iTunes,@)]; NSArray *lApplications = [[NSWorkspace sharedWorkspace] launchedApplications]; int a; for (a=0; a[lApplications count]; a++) { NSDictionary *applicationD = [lApplications objectAtIndex:a];

Re: How to tell if iTunes is running.

2008-05-24 Thread Thomas Engelmeier
On 24.05.2008, at 21:05, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. For third party software you'd be right - Apple does not localize the names of iTunes / iPhoto / iDVD (browse through

Re: How to tell if iTunes is running.

2008-05-24 Thread Jens Alfke
On 24 May '08, at 12:05 PM, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. ... if ([[applicationD objectForKey:@NSApplicationPath] isEqualToString:iTunesPath]) It would be simpler just to

Re: How to tell if iTunes is running.

2008-05-24 Thread Steve Christensen
My version wasn't about using the path for something else; it was only about providing a method that doesn't care what the iTunes application is called. For example, if someone were to rename it iTunes 7.6.2, then your version would stop working. However, as Thomas Engelmeier pointed out

Re: How to tell if iTunes is running.

2008-05-24 Thread Steve Christensen
On May 24, 2008, at 2:11 PM, Jens Alfke wrote: On 24 May '08, at 12:05 PM, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. ... if ([[applicationD objectForKey:@NSApplicationPath]

How to tell if iTunes is running.

2008-05-23 Thread Mr. Gecko
How can I tell if iTunes is running with cocoa. I am working on a program for iTunes and I am going to add a Quit iTunes and Start iTunes menu. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: How to tell if iTunes is running.

2008-05-23 Thread Nick Zitzmann
On May 23, 2008, at 4:01 PM, Mr. Gecko wrote: How can I tell if iTunes is running with cocoa. In this particular case, you should be able to get that information using -[NSWorkspace launchedApplications]... Nick Zitzmann http://www.chronosnet.com/