How to Listen For an Application Launch Event on Mac OS X I wrote an AppleScript to mount a bundled sparse disk image. I want this script to be executed exactly when Time Machine launches.

I can check if Time Machine is running with on idle statement,

on idle
    ....
    return &lt;interval&gt;
end idle


but I'm pretty sure, it isn't a robust way to do that.

IMO making an event trigger for Application Launch event would be a better approach.

I appreciate if someone can help me.
You can use a LaunchAgent (see Lingon) to perform an action when a file is modified. Time Machine has some file somewhere that it modifies each time it starts.