does this work with Dashboard? it seems that dashboard is a background application that's always open...
On Thu, Jan 8, 2009 at 12:58 AM, David LeBer <dleber_...@codeferous.com> wrote: > > 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com