Is there a way, in either Applescript or Objective-C, to detect when a certain application opens? My goal is to add a feature to an application that I’m working on to show a message whenever “QuickTime Player” opens, but I haven’t found a anything in the Apple developer documents that shows how to do anything like this.
Share
This is pretty simple with Objective-C. Here’s the code:
Register for the proper notifications from
NSWorkspace:Then, add your selectors for the notification. The userInfo dictionary of the notification will hold everything you need to know:
Hope that helps.