Applescript Moving Files Around Help Needed

2 replies [Last post]
Offline
Joined: Feb 6 2007
Posts: 2

Hi everybody!

I've been working on a script to move all of my files off of my desktop to my documents when I haven't modified them for three weeks, and than delete them from there when they haven't been modified for 60 days... and I'm stuck. It gives me this error when my folder names that it's moving to are wrong - Finder got an error: Can't get every file of folder "Desktop" of folder "student" of folder "Users" of disk "Macintosh HD" whose modification date < date "Tuesday, January 16, 2007 2:33:49 PM".

tell application "Finder"
move (every file of folder "Desktop" of folder "student" of folder "Users" of disk "Macintosh HD" whose modification date is less than ((get current date) - 21 * days)) to folder "Documents" of folder "MacBookUser" of folder "Users" of disk "Macintosh HD"
delete (every item of folder "Documents" of folder "student" of folder "Users" of disk "Macintosh HD" whose modification date is less than ((get current date) - 60 * days))
end tell

Thanks,
Mike

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
BDub's picture
Offline
Joined: Dec 20 2003
Posts: 706
You're using two different us

You're using two different usernames, "MacBookUser" and "student". At first glance I'd guess that's the issue.

__________________

"There is going to be a future: let's chase it until it kills us." - Spider Robinson

Offline
Joined: Feb 6 2007
Posts: 2
Whoops...

Oops... I missed that the first time through, but, after I fixed that, it simply deleted all of the files in my desktop and documents folder as if it skipped over the date modified detail... any suggestions?

Thanks,
Mike