05-21-2013, 06:51 PM #1
What's wrong with my AppleScript?
- Member Since
- May 21, 2013
I got help from someone to create a script that deletes files in a specific folder after they are more than 2 days old. However, sometimes I get an error message (see attached). The script (see below) is saved as an application that I run automatically at login. If anyone can see something that I'm doing wrong, my appreciation would runneth over. Thank you!
set targetDate to (get current date) - 1 * days
tell application "System Events"
set filesToGo to path of (every disk item of folder "Mac HD:Users:bbotticelliropbox:Brian:Sound Beach Cameras" whose modification date is less than targetDate and visible is true)
tell application "Finder" to delete filesToGo
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By dero in forum Apple DesktopsReplies: 8Last Post: 05-09-2011, 10:30 PM
By shades.of.gray in forum OS X - Operating SystemReplies: 0Last Post: 05-10-2010, 02:06 AM
By katsogiannis in forum OS X - Operating SystemReplies: 0Last Post: 01-10-2010, 04:28 PM
By niclake13 in forum OS X - Apps and GamesReplies: 1Last Post: 08-10-2009, 01:47 AM
By themitch in forum Apple NotebooksReplies: 5Last Post: 04-23-2009, 03:46 AM