Batch Rename files in the Finder



In Yosemite, the Finder finally allows Batch Rename of files by control-clicking on a set of files.

However, the options are fairly limited and their is no preview at all. The end of the TidBITS article and the comments list various third party applications, but I've been using this macro for quite a while and it works well.

It prompts for the search and replace formats, and then asks for each file whether you wish to rename to a specific new name. You can click "Rename All" once you're satisfied your replacement is correct.

There are no options for adding an index or a date, but allowing regular expressions lets you do a fair number of things, and if an index or date was important to you it would not be hard to add a step to the macro that replaced some resulting fixed string with an index or a date.

Rename Files.kmmacros (7.8 KB)

Best Macro List
Toggle Finder File Selection to Web Friendly Names
Find files and rename
BBedit separate lines?
Rename Files in the Finder With Sorting From a Spreadsheet
Newbie Help - changing text order in a variable?

This is fantastic Peter, almost what I was looking for and better in some ways. Thanks for sharing.


Peter I didn’t know about the addition to the Finder. It’s about time. Great script by the way.

I noticed something as I imported it. I had selected a group I wanted to add it to. When the macro imported it actually created a new group called “Finder”. Is this the group you had originally assigned it to?


Yeah, macros import where they were originally, when they were exported. If you want more control over that, see this:



I may. However I am trying to hold back on importing everything so I can stay more focused. I am also trying to finish reading the manual. (If I could just stop reading this darn forum!) I think I can make better use and choose macros I need much more wisely if I understand it better.

For me this is a character flaw. I bought a Mac to start creating music. Upon first using it I realized “I don’t know anything about this Mac and I need to learn more in order to use it effectively.” Two years later, I still hadn’t created music. (I think people call this ADD?) Heh! Anyway I try and create lists of what I need to do and stick to it. It’s even harder now with my daughter coming in every once in a while, wanting to show me things or asking for help with something. Yet I attempt to persist.


I totally get what you’re saying. I’m the same way.

But here’s the problem, when it comes to KM. You can’t just sit down and read the manual. You only learn by doing things. And for me, the only way I do things, is to do them when I need them, which is often when I’m in the middle of something else.

For example, I’m in the middle of something now, but I’m going to stop and work on the Palettes tutorial, because I’ve been meaning to for a long time, and I never get around to it.

So here’s what I do instead: I leave myself breadcrumbs. Notes that will lead me back to whatever I was working on when I jumped down a rabbit trail. Sometimes it gets 5 or 6 holes deep, or even deeper. But I can always find my way back.


I’d put that a little differently.

You can only learn so much by reading the manual.

It’s a good idea to read through it and become generally familiar with Keyboard Maestro’s capabilities and terminology, but the real learning comes from constructing your own macros and from deconstructing other people’s to see how they work.



This no longer works for me, as the Finder says "destination already exists".



Hey @aeko,

What version of Keyboard Maestro are you using?

What version of macOS?



macOS 10.13.6
KM 8.2.4


Hey @aeko,

I just tried the macro on macOS 10.12.6, and it worked fine.

It does complain if one or more files is not renamed, but it renames files correctly with plain-text and RegEx with my tests (so far).

Please provide exact examples of what is not working for you.