views:

43

answers:

1

Hey all,

I was wondering if there was a way to write a Cocoa app that listened for OS system events such as an application launching, a window switches, etc, etc. My thought was to watch [NSNotficationCenter default] for messages but so far I haven't been able to find much. Does anyone have any suggestions?

Thanks!

+1  A: 

Some messages that might interest you would be provided to [NSWorkspace notificationCenter], such as when apps launch, come to the front, or quit.

I'm not sure what you mean by "window switches". If you mean changing which window is in front without changing which app is in front, that's generally considered "none of your business" on the Mac.

JWWalker