Renaming without prompt

Hi there! Thanks for your help with this. I found the batch rename macro in KM, but I don't know how to tweak it to not prompt anything and to automatically replace the filenames with what I have in the clipboard.

I'll always need to replace "Project Title - Composer" with what I have in the clipboard.
Screen Shot 2022-09-12 at 11.02.05 PM

Thank you!!!

Which specific macro are you referring to? There are many ways to batch-rename files.

Start with what you do know -- and don't limit it to Keyboard Maestro knowledge!

If each file name was a piece of text, eg in Word, how would you do this? Which of KM's many actions look like they replace text? Are there any tokens that would let you use the contents of the clipboard?

If you can put that together so you can change the text in a variable from "Project Title - Composer - Version 2" to "<contents of clipboard> - Version 2" -- you're halfway there! You can either drop that in to the macro you already have in place of its "name-mangling" bit, or borrow bits of that macro to add to yours to get folder selection, the changing of the name, etc.

1 Like

For this specific use case, this simple macro should be sufficient:

Rename Selected Folders with Text on Clipboard.kmmacros (21 KB)

Macro screenshot

1 Like

We can actually go even simpler -- you don't need the Parent path when renaming in place. And, at the risk of making things less clear, we can drop "Split Path" altogether!

renameInPlace

4 Likes

[-1]/

What is this sorcery?!

Silly me. In my defence, the missus was up all night with some kind of tummy bug, so I'm not on all four cylinders today! :yawning_face:

He-he!

In all honesty, I think I prefer the "Split Path" action, it makes it explicit what's happening rather than forcing the brain into action to decode some weird symbols -- "So we're treating the path as an array, delimited by /, then taking the last element, which is the name of the file or folder... Why didn't you just say that, you numpty!?".

2 Likes

Guys...you are amazing, thank you so much for the quick replies to help me! It's been less than a week and I'm already addicted to KM, will spend the whole weekend getting more knowledge!

2 Likes