0
votes

I need to MOVE (not copy) every file (including subfolders) in "Downloads" to an external drive called "Drive" in the location "Volumes/Drive/Apple/MacBackup/Downloads". I have tried countless times and it is just not working... Here is my code right now:

tell application "Finder" to move entire contents of folder "Users:myUsername:Downloads" to folder "Drive:Apple:MacBackup:Downloads"

I am getting the error:

Finder got an error: Can’t get folder "Users:myUsername:Downloads".

2

2 Answers

0
votes

HFS paths have to begin with the name of the disk, like

"Macintosh HD:Users:myUsername:Downloads"

You have probably taken it from a POSIX path, were the first slash represents the startup volume.

To be sure just run

choose folder

and copy the path from the result.

0
votes

The error is because that is not a correctly formed path. You should use the special folder designation (path to downloads folder).

tell application "Finder" to move entire contents of (path to downloads folder) to folder "Drive:Apple:MacBackup:Downloads"

Also, I would strongly encourage you to copy the files, then delete the old files. Moving files is asking for trouble if something happens mid-process, and it's lost in transit. (think star trek transporter problem)