I'm running Snowleopard 10.6.8 on a Macmini server and I want this server to execute a script whenever a file or folder is inserted/edited or deleted from a specified folder. Since I'd like this behaviour to work over the network when the system is on (but not logged in) I made a .plist script which is set as a LaunchDeamon. The .plist has the same rights as all my other .plists: "System: read&write. Wheel & Everyone: read only"
As a testcase I set up the following script with a little help from lingon 2.1.
This script should execute growltime.scpt, whenever the Desktop (<WatchPaths>
) detects a change or when something is mounted (<StartOnMount>
).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.watchfolder.growltime</string>
<key>ProgramArguments</key>
<array>
<string>osascript /Users/admin/growltime.scpt</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartOnMount</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Users/admin/Library/Desktop/</string>
</array>
</dict>
</plist>
Now the strange thing is, growltime.scpt will ONLY run when I mount a disk or an installation file is mounted (<StartOnMount>
), but NOT when a file or folder has been inserted/edited or deleted within the Desktop (<WatchPaths>
).
What am I doing wrong here?