Copy all files from External HDD

Discussion in 'Mac Programming' started by KeanYau, Aug 29, 2014.

  1. KeanYau macrumors newbie

    Aug 29, 2014

    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
  2. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Much easier with bash, isn't it?

    mv /path/to/source/* /path/to/destination
    I might have the source and destination backwards - check the man page for mv.
  3. kryten2 macrumors 6502a

    Mar 17, 2012
  4. KeanYau thread starter macrumors newbie

    Aug 29, 2014

Share This Page