I want to execute automator script when user plug in a pendrive with specific name.
How can I do it?
I want to execute automator script when user plug in a pendrive with specific
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Applescript and automator cannot do this. However launchd can. Launchd can watch folders, and if something changes in the folder then launched will run your command. In your case you would want to watch the /Volumes folder. When you mount the USB drive it’s mount point will be that folder. Therefore you need to write yourself a launchd plist file, and your command could be to run your automator script. Just google for more info on launchd. I did a quick search and this link gives most of the information you need.