I have an external drive. Is it possible to launch a program or perform an action when I connect it or plug it in?
The likely most robust solution is to create a
launchd job with the
StartOnMount property set to
This optional key causes the job to be started every time a filesystem is mounted.
This is how Time Machine does it (see
You need to check if the desired
/Volume/... is available, but in my experience, it's faster than using Folder Actions.
A similar question has been posted in the MacRumors forum here:
The specific suggestion there is to use the application MarcoPolo.