This article originally appeared in TidBITS on 2014-11-21 at 3:03 p.m.
The permanent URL for this article is: http://tidbits.com/article/15253
Include images: Off

How to Batch Rename Files in OS X 10.10 Yosemite

by Josh Centers

One of OS X 10.10 Yosemite’s most useful new features — batch renaming in the Finder — has gone largely overlooked in the weeks since its release. In the past, you had to use a third-party utility, Automator, or some kind of shell script to rename a set of files quickly.

Batch renaming has a number of uses. For instance, if you’re trying to reduce paper in your office (as Joe Kissell suggests in “Take Control of Your Paperless Office [1]”), being able to rename several PDF documents — such as scanned electric bills — at once is essential. Similarly, automatically generated log files or still images from a webcam might also lend themselves to batch renaming.

To get started, select the files you wish to rename in the Finder, using any of the standard methods. (Press Command-A if you want everything in the current folder; drag a selection box around them; select the first file in the series and then Shift-click the last file of the series; or press Command and individually select files.)

Once you’ve selected the files, Control-click one of the selected files, and choose Rename # Items, where # is the number of files selected.

[image link] [2]

In the resulting dialog, a pop-up menu lets you choose which action to take: replacing text, adding text, or performing more complex formatting. Pay particular attention to the preview in the lower left of the dialog, which shows you what the renamed files will look like. The options are:

Format offers three different name formats that combine the files’ existing names with an index, counter, or date, each of which can appear before or after the name:

You can also replace the existing filenames by using the Custom Format field. The photos in my example screenshots are already named by date and time, and in the example below I’m renaming the files to start with “Harris-Halloween-” plus an index number.

[image link] [5]

This isn’t the sort of feature that most of us will need every day, but it’s important to remember that it exists for those times when you want to avoid the tedious task of renaming a slew of files according to a simple pattern.

Of course, independent Mac developers have long offered utilities that provide even more capabilities. Name Mangler [6] from Many Tricks comes recommended by our own Jeff Carlson and Federico Viticci of MacStories, and others like A Better Finder Rename [7] are also excellent choices. And if you want to rename files automatically, try Noodlesoft’s Hazel [8], but take care when setting it up, since with great power comes great ease in messing things up. I recommend testing on a subset before letting Hazel loose on a large number of files. For more on Hazel, see Joe Kissell’s “Take Control of Automating Your Mac.”

[1]: http://tid.bl.it/tco-paperless-office-tidbits
[2]: http://tidbits.com/resources/2014-11/Finder-batch-rename.png
[3]: http://tidbits.com/resources/2014-11/Finder-Replace-Text.png
[4]: http://tidbits.com/resources/2014-11/Finder-Add-Text.png
[5]: http://tidbits.com/resources/2014-11/Finder-rename-Format.png
[6]: http://manytricks.com/namemangler/
[7]: http://www.publicspace.net/ABetterFinderRename/
[8]: http://www.noodlesoft.com/hazel.php