Is there a way to somehow hook into the system event of an Application Launch in Mac OS X? For example, let's say that I want a simple script or program to run each time a specific application is opened. I'm hoping that there is some sort of Cocoa API to do this, but I have not found one yet.
Ah, I figured it out on my own. There's a class called NSWorkspace that contains a NSNotificationCenter that you can add observers too. I added an observer for name "NSWorkspaceDidLaunchApplicationNotification" and this seems to do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With