Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the TidBITS Content Network for Apple consultants.

How to Batch Rename Files in OS X 10.10 Yosemite

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”), 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

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:

  • Replace Text, which lets you find one string of text and replace it with another. In this screenshot I’m replacing the date with “Harris-Halloween”. Unfortunately, the Finder’s batch rename tool doesn’t understand wildcards or regular expressions, so there’s no easy way to get rid of the timestamp with Replace Text (but see below for an alternate approach).


  • Add Text, which adds a string of text before or after the file name. Here I’m adding “Harris-Halloween-” to the start of the filename.


  • Format, which either adds to or replaces the name with a pattern.

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:

  • Name and Index inserts a number, starting with the number of your choice
  • Name and Counter does the same, but in a five-digit format, like 00055
  • Name and Date adds the date in this format: YYYY-MM-DD at HH.MM.SS AM/PM

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.


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 from Many Tricks comes recommended by our own Jeff Carlson and Federico Viticci of MacStories, and others like A Better Finder Rename are also excellent choices. And if you want to rename files automatically, try Noodlesoft’s Hazel, 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.”

 

Make friends and influence people by sponsoring TidBITS!
Put your company and products in front of tens of thousands of
savvy, committed Apple users who actually buy stuff.
More information: <http://tidbits.com/advertising.html>
 

Comments about How to Batch Rename Files in OS X 10.10 Yosemite
(Comments are closed.)

John Robinson  An apple icon for a TidBITS Supporter 2014-11-21 18:20
I'm not sure I like being forced to use 5 digits when selecting "name and counter". The 3rd party utility I use allows me to select how many digits to count. Seeing a ton of zeros in a folder is a waste to me, but OMHO.
Mike Vlasman  An apple icon for a TidBITS Contributor 2014-11-22 00:12
I use, and like, the donationware program, Name Changer from MRR Software .
Thomas Peak  2014-11-22 03:03
It is a good start but not enough for me to give up Name Mangler. Whilst regular expressions are not everyone's cup of tea, I can't live without the feature.
Wub-Fur Internet Radio  2014-11-22 13:25
When the old PPC-only renaming utility I used to use (R-Name) stopped working I tried both Name Mangler and A Better Finder Rename. I can't remember exactly why anymore, but I preferred A Better Finder Rename (price & features of both apps are quite similar).
Edward Minot  2014-11-23 17:05
I have also found A Better Finder Rename a valuable and very powerful tool for batch file renaming. For digital photos especially, it is handy to use it together with A Better Finder Attributes. The latter app allows correction to file information such as exif time stamps. That's useful, for example, when I forget to correctly reset the date/time on a camera. So it does for file attributes what A Better Finder Rename does for file/folder names. Both apps are well maintained and updated by Frank Reiff. As mentioned earlier, with power comes the ability to create carnage. A Better Finder Rename is quite good at displaying what will happen, but I still proceed with caution.
William Robinson  2014-12-07 18:09
R-Name still works on Yosemite. But you need the newer "Intel" version.
Peter Breis  2014-11-24 19:28
I have A Better Finder Rename and tried Mangler and Automtor but use Renamer. It is permanently on my Toolbar.
It is very visual and the easiest to follow what it is doing, and to create portable presets for.
If it takes longer to debug the procedure than to manually do the task, batch conversion isn't doing its job.
Gustavo Domínguez  2014-11-26 00:52
This is amazing, I don't know how I hand't noticed. I used to use Automator too.

Automator is not a third-party program, though.
Steve Nicholson  2014-12-06 16:56
He didn't mean Automator was a third-party program. That was a list of three things: 1) a third-party utility, 2) Automator, and 3) some kind of shell script.
Simon Browne  2014-12-23 04:12
Second vote for Name Changer from MRR Software. I use it to rename multiple photos and it works very well. One tip, return the Action to Replace First Occurrance with .. when you have completed the current task. The developer is a great guy too. I also use a Better Finder Rename for the full Creation Date / Time format to match the format generated by DropBox when uploading photos from my phone.