How do I specify path in Applescript?
Trying to implement the following AppleScript:
tell application "Finder"
delete (every item of "Mac HD:Users:bbotticelli:Dropbox:Photos" whose modification date is less than ((get current date) - 7 * days))
end tell
My goal is to run this script to delete any files located in the "Photos" folder that are older than a week. However, AppleScript Editor returns this message when I attempt to run the script:
error "Can’t get {\"M\", \"a\", \"c\", \" \", \"H\", \"D\", \":\", \"U\", \"s\", \"e\", \"r\", \"s\", \":\", \"b\", \"b\", \"o\", \"t\", \"t\", \"i\", \"c\", \"e\", \"l\", \"l\", \"i\", \":\", \"D\", \"r\", \"o\", \"p\", \"b\", \"o\", \"x\", \":\", \"P\", \"h\", \"o\", \"t\", \"o\", \"s\"} whose modification date < date \"Thursday, March 8, 2012 4:30:12 PM\"." number -1728
I've also tried to specify the path as:
tell application "Finder"
delete (every item of folder "Photos" of folder "Dropbox" of folder "bbotticelli" of folder "Users" of startup disk whose modification date is less than ((get current date)) - 7 * days)
end tell
Thank you in advance, any help would be greatly appreciated!