Skip to content

Instantly share code, notes, and snippets.

@josephholsten
Created March 3, 2009 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephholsten/73388 to your computer and use it in GitHub Desktop.
Save josephholsten/73388 to your computer and use it in GitHub Desktop.
set source_folders to the selection of application "Finder"
set destination_folder to choose folder with prompt "Select folder to merge into:"
CopyAndMergeFolders from source_folders into destination_folder
to CopyAndMergeFolders from sourceFolders into destinationFolder
if (count sourceFolders) is equal to 0 then error "No source files selected"
set dest_path to quoted form of POSIX path of (destinationFolder as alias)
set src_paths to ""
repeat with n in sourceFolders
set src_paths to src_paths & (quoted form of POSIX path of (n as alias)) & space
end repeat
do shell script "ditto " & sources & space & destination_folder
end CopyAndMergeFolders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment