I have script to find .mov files in a folder (including subfolders), and copy them to a new folder. Except I can’t get the copying to work.
Script is as follows:
set sourceFolder to quoted form of POSIX path of (choose folder with prompt "Select source folder containing files to copy")
set destFolder to quoted form of POSIX path of (choose folder with prompt "Select destination folder")
set filestoCopy to paragraphs of (do shell script "mdfind -onlyin " & sourceFolder & " 'kMDItemFSName = \"*.mov\"'")
tell application "Finder"
duplicate filestoCopy to folder destFolder with replacing
end tell
The list of files generates fine. The duplicate part throws an error…
set sourceFolder to (choose folder with prompt "Select source folder containing files to copy")
set destFolder to (choose folder with prompt "Select destination folder")
tell application "Finder"
duplicate (every item of entire contents of sourceFolder whose name extension is "mov") to destFolder with replacing
end tell
But MUCH faster than manual approach, so I am happy.
set sourceFolder to quoted form of POSIX path of (choose folder with prompt "Select source folder containing files to copy")
set destinationFolder to quoted form of POSIX path of (choose folder with prompt "Select destination folder")
do shell script "mdfind -onlyin " & sourceFolder & " -0 'kMDItemFSName = \"*.mov\"' | xargs -0 -J {} cp {} " & destinationFolder