Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

KeanYau

macrumors newbie
Original poster
Aug 29, 2014
2
0
Hi,

I am new to Apple Script and would like to make a script to copy all files from external HDD to a folder in Desktop. It works from a folder to another folder in local HDD but was not successful when I want to copy the file from external HDD. The script was written as below but error with "files in external HDD location was not found." New Volume is the name of my external HDD. Can anyone advise? :confused:

tell application "Finder"
set source_folder to "/Volumes/New Volume"
set target_folder to folder "Test" of desktop
set the_files to every file of source_folder
repeat with each_file in the_files
set file_name to name of each_file
if not (exists file file_name of target_file) then
duplicate each_file to target_folder
end if
end repeat
end tell
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
Much easier with bash, isn't it?

Code:
mv /path/to/source/* /path/to/destination

I might have the source and destination backwards - check the man page for mv.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.