Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

anonxa

macrumors newbie
Original poster
Jul 14, 2009
1
0
Forgive the complete noobishness, but I am new to the Mac OS platform (at least from the coding perspective, been a user of a few years now). I need to know if there's any easy way for a program to detect when other apps are launched (i.e. iTunes, Safari, Skype, etc. ). Currently trying to automate some things via python and it's been a bit of adventure in and of itself. I'm hoping to tie this in with other projects later on and said projects would be easier when one script knew when things were launched / killed / quit unexpectedly / etc.

Advice, pointers, other info? Thanks so much in advance.
 
launch notification

Hey use NSWorkspace for it in cocoa

NSNotificationCenter *notCenter;
notCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
[notCenter addObserver:self selector:mad:selector(workspaceDidLaunchApplication:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];

now implement

- (void)workspaceDidLaunchApplication:(NSNotification *)note

above method will get called automatically when application is launched

Hope this will help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.