How to run Applescript on Disk mount I want to run an Applescript when I mount a specific disk. It isn't if the script is located on the disk or not, it should just run when OS X mounts the disk.

I tried to accomplish this with folder actions, but it looks like it isn't possible to do it this way.

Clarification:


I get home with my Macbook
I plug my USB Hub into the device
External disks are mounted in OS X
My Applescript gets run, does some stuff on those disks 


I want to automate step 4.
The likely most robust solution is to create a launchd job with the StartOnMount property set to -boolean YES:


  StartOnMount &lt;boolean&gt;
  This optional key causes the job to be started every time a filesystem is mounted.


This is how Time Machine does it (see /System/Library/LaunchDaemons/com.apple.backupd-attach.plist).