How can I select all files within a directory with subfolders?

I'm in the process of cleaning up my wickedly bad "Digital Photos" folder. I've got a workflow I like, but I need a better way of selecting the files. What I'd like to be able to do is select a top-level folder and somehow automagically select all the *.jpg files within both that folder AND any subfolders. I need to move all the *.jpg files to a single directory for easier processing, and having to do it one folder at a time after 10+ years of mis-matched filing systems is just taking way too long.


Solution 1:

I created an Automator application that does what you're looking for. You can download it here.

It's pretty simple, just drag-and-drop any folder onto the application, it will then find all images in the folder and any subfolders, and prompt you for a destination to copy them to.

If you'd prefer to activate it by a hotkey or the right-click menu, you can make it into a service by following these steps:

  1. Open the application in Automator.
  2. Choose File → Convert To… and select Service.
  3. Change the first drop-down at the top to folders.
  4. Save it and give it a name.
  5. Optional: open the Services menu within Keyboard Preferences. You can assign a keyboard shortcut there.

Once you've done that, you should be able to activate the service by right clicking on any folder, or hitting your shortcut key with a folder selected.

Solution 2:

You could also restrict Spotlight to specific folders or file types and then move all the result files.

Solution 3:

I wrote a shell script for you:

https://github.com/tjluoma/move-all-by-ext

It involves using the Terminal, but there are explicit instructions on the Github page.

It won't overwrite files if there are filename duplications, you'll have to find a way to rename those files.

Solution 4:

I really like an application called Hazel for this sort of thing. It saves me a ton of time and continues to sort files for me as they come!