Help with file delete location
As of now, I have a LaunchAgents plist that enacts the script below at midnight. The code only deletes specified files on the Admin desktop. I would like it to wipe said files off any regular users desktop. If it searches and clears the Admin too, thats ok, as long as it works and the regular priveledge users. Also, in the plist below, what would I change to make it work twice a day. (noon and midnight)
tell application "System Events"
-- find all pdf files that were created between 1 hour and 26 hours ago that start with face_sheet
set lowerLimit to ((current date) - 1 * days - 2 * hours)
set upperLimit to ((current date) - 1 * hours)
delete (files of desktop folder of user domain whose type identifier is "com.adobe.pdf" and creation date ≥ lowerLimit and creation date < upperLimit and name starts with "face_sheet_")
end tell
<?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>user.delete.daily</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/path/to/script file.scpt</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>0</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
MacBook Pro, OS X Mountain Lion (10.8.2), 2.3 GHz i5, 4GB RAM, OCZ 120GB SSD