Re: App Listener?
Re: App Listener?
- Subject: Re: App Listener?
- From: David LeBer <email@hidden>
- Date: Thu, 8 Jan 2009 00:58:52 -0500
On 8-Jan-09, at 12:46 AM, Chunk 1978 wrote:
is it possible to set up an NSNotification to listen for launched
apps? for example, an running app would do something if Safari is
opened, or if Dashboard is activated?
Something like this?
NSNotificationCenter * center = [[NSWorkspace sharedWorkspace]
notificationCenter];
[center addObserver:self selector:@selector(appLaunched:)
name:NSWorkspaceDidLaunchApplicationNotification object:nil ];
This should give a notification for every app that is launched.
Check the notification's userInfo dictionary get the launched app's
identity
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden