Rename Hundreds of Photos – Mac Kung Fu, 2nd Edition

Tip 115Rename Hundreds of Photos

Digital cameras seem to like filenames such as DSCF0407.JPG. I don’t know about you, but I prefer names such as Disneyland Vacation 023.jpg. Renaming each and every file can be somewhat annoying, but a quick and easy solution is to create a simple app to do it for you, and that’s just the kind of thing Automator is for (to learn what Automator is, see Exploring OS X: Automator).

Creating an Automator Renaming Tool

Here are the steps required to create the Automator tool:

  1. Create the folder to store the photos. This can be anywhere and called anything you choose. Then copy the image files into it. Make sure you only copy and don’t move the files—keep the originals safe until you’re sure the renaming has worked correctly!

  2. Start the Automator program. It’s among the first programs listed in the Applications view of Finder; its icon is a robot.

  3. In the Choose a Type for Your Document dialog that appears, click the Application icon (again, the icon that’s a robot), and then click the Choose button. If the Choose a Type dialog doesn’t appear, click FileNew.

  4. The Automator program window is a little daunting, but you can ignore most of it. In the Library list at the left of the Automator program window, select Files & Folders, and then in the list to the right, select Rename Finder Items. Click and drag this menu entry to the right of the program window and release over the spot that reads Drag Actions or Files Here to Build Your Workflow.

  5. In the dialog box that appears, you’ll be asked whether you want to add an additional action to copy the renamed files. You don’t need to do this, so click the Don’t Add button.

  6. You’ll see a new element on-screen, Replace Text. There, click the drop-down Add Date or Time, and select Replace Text.

  7. Click the Options heading at the bottom of the Replace Text “bubble,” and check Show This Action When The Workflow Runs. For an example of how it should look at this stage, see Figure 19, Renaming files automatically using Automator.


    Figure 19. Renaming files automatically using Automator
  8. And that’s all you need to do! Click FileSave and then give your new Automator Action a name. Anything will do, such as Rename Pictures. Choose somewhere to save it to, such as the desktop.

  9. Once saved, you can quit the Automator program. There’s no need to click the Run button or test anything.

Your new Automator action icon will be where you saved it, and you can identify it by the same robot icon as the Automator application itself. Essentially you’ve created a small app dedicated to the purpose of renaming files, and you can drag and drop files onto it to make it work.

Using the Automator Tool

Using your new Automator app is easy, as follows:

  1. Start by dragging and dropping the image(s) you copied earlier onto the new Automator icon. A dialog box will appear.

  2. You’ll now need to use Finder to browse the store of photographs you want to rename in order to gather some information. Look at the typical filenames generated by your camera and work out which part you want to replace with your own text. For example, photos from my camera always have a filename that begins with DSCF, followed by a sequential number, followed by the .jpg file extension. A typical filename might be DSCF0404.JPG. You might find the files begin with IMG_, again followed by a sequential number, leading to filenames like IMG_0034.JPG. In either case, the goal is to replace DSCF or IMG_ with something more descriptive, such as the location of the vacation you took. So, make a note of this part of the filename.

  3. Go back to the Automator app’s dialog box and in the Find field of your new action, enter the text you’d like replaced in the filename. (To continue my examples, I would type DSCF or IMG_.) In the Replace field, type the text you want to appear instead. For example, for my most recent vacation, I might type Disneyland Vacation.

  4. Click the Continue button, and the files will instantly be renamed.

Once you’ve finished, you can either leave the Automator app where it is for future use or delete it.