Usually I get an excel spreadsheet with dozens of filenames, for which I then need to go and search individually.
Is there a way that I could simply:
- Select All filenames in e.g. row A of Excel,
- then Search for all these files on "This Mac"
- then Copy all found files into the New Folder on the Desktop
So far I've tried the first part of searching and this is what i get :a)
Automator with Variable. But the problem is, it only searches for 1 file from selection
b)
c) /usr/bin/pbcopy
on run {input, parameters}
tell application "System Events"
keystroke "f" using {command down}
keystroke "v" using {command down}
end tell
return input
end run`
End result, is same as option b). I was planning to run this in Automator as a 'Service', which I could later assign to Keyboard Shortcut.
I am pretty sure there should be a simple shell option for this - any advice would be much appreciated.
I made a
bash
script that does what you want. You would basically select a bunch of filenames in Excel, or any other app, and copy them to the clipboard with ⌘C. After that you need to run the script and it will take items from the clipboard and search for TIFF or JPEG images that match that name and copy them to a directory on your Desktop calledSelected Files
:I am not sure of your level of familiarity with
bash
, so you may be able to ignore the following...Make a new directory for your own scripts:
Save the above script in that directory with filename:
Make the script executable by typing this into Terminal:
Edit your login profile (
$HOME/.profile
) and add your$HOME/scripts
directory to your PATH:Then start a new Terminal and you can use any script that you have saved in
$HOME/scripts
without needing to specify the full path to it, e.g.:Following information kindly contributed by @user3439894 in comments section, as I am out of my depth on this aspect...
To use a keyboard shortcut, you'd have to create an Automator "Service workflow" with a "Run Shell Script" action, which you can assign a keyboard shortcut to under: System Preferences > Keyboard > Shortcuts > Services