Batch Rename files in the Finder

files_folders
finder

#1

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
BBedit separate lines?
Newbie Help - changing text order in a variable?
Find files and rename
#2

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


#3

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?


#4

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


#5

Thanks!

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.


#6

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.


#7

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.

-Chris