I have an old script that won’t run now due to the ‘move’ bug in apple events. Can someone help with a fix? I’m only good enough at applescript to be dangerous to myself.
somehow i ended up with a large amount of ‘dupe’ files in a folder. they’re not really dupes-they’ve been renamed like file.jpg, file 1.jpg
So, I’ve written a script to identify and create an array of the filenames with a space in the name. Then, when the apple events ‘move’ command still worked, it was trivial to move them to another folder.
But, now I’m stuck. I can’t easily move them in the finder due to the way I’ve collected the file names. Is there another way to easily group these files? I thought maybe labeling them and then sorting in the finder by label?
Here’s the script so far. Any ideas would be welcome. thanks.
set sourceFolder to POSIX path of (choose folder with prompt "Select folder with all files to parse.")
set targetFolder to (choose folder with prompt "Select the destination folder for the dupes?")
set searchString to text returned of (display dialog ¬
"Select a string to search" default answer " 1.jpg")
do shell script "find " & quoted form of sourceFolder & " -iname *" & quoted form of searchString & " ; true"
set theFiles to paragraphs of result
display dialog "Move " & (count theFiles) & " files." default button "Cancel"
-- 7/4/2022 System Events move command is broken as of 10.9
tell application "System Events"
move theFiles to targetFolder
end tell