Applescript Moving Files Around Help Needed

3 posts / 0 new
Last post
Offline
Last seen: 17 years 10 months ago
Joined: Feb 6 2007 - 14:02
Posts: 2
Applescript Moving Files Around Help Needed

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

BDub's picture
Offline
Last seen: 2 years 9 months ago
Joined: Dec 20 2003 - 10:38
Posts: 703
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.

Offline
Last seen: 17 years 10 months ago
Joined: Feb 6 2007 - 14:02
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

Log in or register to post comments