Detect when a disk is mounted

Hi,

I’ve written a script that parses a text file and copy files from one place to another.
What I’d like to do now, is to be able to detect when a disk is mounted and look for that file on the disk.

I couldn’t find how to execute my script when a disk is mounted.
Anyone can help?

Thanks a lot.
e9

Search this site. There are many answers to this question with varying ways to solve it.

Hi,

watching the folder /Volumes with launchd is the best solution.
This thread is a good point to start.