Here is a AppleScript that has three prompts:
- Your text file containing a list of the images to move
- The folder containing 27 000 images
- The folder where 6000 are moved too.
Assumptions:
- The list is one image name per line.
- Those 27 000 images are not in sub-directories though that can be managed with an additional word in the script.
- No duplicates handling in the script
Flow:
- Prompt for the list of images to move
- Prompt for the folder containing the 27 000 images
- Prompt for the destination folder of the 6000 images
- Read list of images into a list
- Get list of files in among the 27 000 that match the list of names
- Move each file to the destination folder
It is AppleScript so it won't be quick, but it is methodical. Copy and paste the following into Script Editor (Dock : Launchpad : Other : Script Editor). Click the compile button, and then click run.
property istext : {"public.text", "public.plain-text"}
property adesktop : (path to desktop) as alias
set moveList to {}
set matchList to {}
set myList to (choose file with prompt "Select file containing list:" of type istext default location adesktop without invisibles, multiple selections allowed and showing package contents)
set inFolder to (choose folder with prompt "Select Image move-from folder: " default location adesktop without invisibles, multiple selections allowed and showing package contents)
set outFolder to (choose folder with prompt "Select Image move-to folder: " default location adesktop without invisibles, multiple selections allowed and showing package contents)
set moveList to read myList as «class utf8» using delimiter linefeed
tell application "Finder"
set matchList to (every file in folder inFolder whose name is in moveList) as alias list
repeat with anItem in matchList
move anItem to folder outFolder
end repeat
end tell
return