Imported from the Apple Support Forums via the Wayback Machine 🔗
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.
-- matchmove.applescript-- read in list of images from a text file, and then select only those matching-- images in the inFolder. Move each matching file from the inFolder to the outFolder.-- Reference: https://discussions.apple.com/thread/250161568-- VikingOSX, 2019-02-13, Apple Support Communityproperty istext : {"public.text", "public.plain-text"}
property adesktop : (path to desktop) asaliasset moveList to {}
set matchList to {}
set myList to (choose filewith prompt "Select file containing list:"of type istext default location adesktop without invisibles, multiple selections allowed and showing package contents)
set inFolder to (choose folderwith prompt "Select Image move-from folder: " default location adesktop without invisibles, multiple selections allowed and showing package contents)
set outFolder to (choose folderwith prompt "Select Image move-to folder: " default location adesktop without invisibles, multiple selections allowed and showing package contents)
# read the text file contents into a list of the images to moveset moveList toread myList as «class utf8» using delimiter linefeedtellapplication"Finder"set matchList to (everyfilein folder inFolder whosenameisin moveList) asaliaslistrepeatwith anItem in matchList
move anItem to folder outFolder
endrepeatendtellreturn
0
John-Eagleton·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Just wow! It worked perfectly. Thank you so much, you really made my day.
0
VikingOSX·
Imported from the Apple Support Forums via the Wayback Machine 🔗