Trigger an automator workflow when an application opens

Hi,


I am wanting to trigger an automator workflow/action when I open a specific application


How do I do this?


Thanks


Rich

iMac (24-inch Mid 2007), OS X Mountain Lion, WD FreeAgent 1TB

Posted on Oct 30, 2013 5:09 AM

Reply
1 reply

Oct 30, 2013 1:38 PM in response to Richard London

You would have to continually monitor if the App is opened.

Is this for your own use? If so, instead of triggering the Workflow when an App is opened, Have the Workflow trigger the App.


For example, I have iTunes on a Network drive.

The following Applescript App mounts the network drive, pause, then open iTunes (I also used ⌘I to change the App icon to User uploaded file) When I quit iTunes, it ejects the drive.




tell application "Finder" to mount volume "afp://Mac-mini.local/Music"

tell application "iTunes" to launch

tell application "iTunes" to activate

repeat

tell application "System Events"

if name of every process does not contain "iTunes" then exit repeat

end tell


delay 60

end repeat

tell application "Finder" to eject the disk "Music"

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Trigger an automator workflow when an application opens

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.