Clever Bulk Rename Trick in Windows

Stumbled into a clever way to rename a bunch of files to have the same prefix and a sequential numbered suffix… from the Windows GUI no less.

Ever want to rename a bunch of files to the same prefix, but have an incremental count after them?

From Explorer, select all the files that you want to bulk rename, right click, and select Rename.

While all of the files will be selected, only one is editable. Give the file a name, let’s pretend for the sake of discussion you typed ABC.jpg.

All of the rest of the files will be renamed ABC (1).jpg through ABC (n).jpg, where ‘n’ is the number of files minus one, since the first one doesn’t get a number.

Knowing this, you can do some clever stuff. Create one bogus file renamed to ZZZZZZZZ.TXT at the end of your list; select all the files, and bulk rename them as shown above. Then delete the bogus file, it should be the only one without a number, and you’ve just made a sequence of files.

OS X: Batch Rename from GUI

This is the third time I’ve had to go hunting how to enable batch filename manipulations for OS X. Now I’m documenting it so I don’t have to hunt this down again.

I keep forgetting about this trick, so I thought I’d post it in the event I have to ever do it again.

Part of the problem with a graphical GUI is that it’s very difficult to rename files in batches, for instance, prepending some text to a group of files.  This kind of thing is fairly trivial at the command line.

Apple has a facility to do this, but as it’s not something a regular user does often, it’s not enabled by default.  Here’s how to get all kinds of additional functionality out of OS X.

1) Open /Applications/AppleScript

2) Turn on Show Script Menu in menu bar

3) Optional: turn on GUI scripting, show library scripts, and choose where to show them.

You’ll notice up near the time in the menu bar a black scroll has appeared.

All the batch renaming and filename twiddling stuff is under the Finder Scripts.

UPDATE 19-Dec-2009: Upgrading to Snow Leopards deletes some useful scripts, specifically the Finder Scripts.

UPDATE 31-Aug-2010: The scripts live in “/Library/Scripts/Finger Scripts” and are

  • Add to File Names.scpt
    md5 4b0cd899acb19b5fc62ef2049d81a933 – 18114 bytes
  • Change Case of Item Names.scpt
    md5 af7429228be4d0e1a096092af5341c52 – 17808 bytes
  • Replace Text in Item Names.scpt
    md5 716493cab1c569953a7f40d76ed9a1f7 – 24328 bytes