in July 2023, @cfriend added a very useful macro (below) to the library to batch search replace rename macros. I use if often
2023-05-04 Update: Rewritten after the Satimage.osax died.
[KM] Rename Macros with RegEx S&R.kmmacros (7.1 KB)
Macro Image <a class="lightbox" href="https://forum.keyboardmaestro.com/uploads/default/original/3X/d/6/d6099d5e1438bca7acf21f46fe99bdce1ededf9a.jpeg" data-download-href="https://forum.keyboardmaestro.com/uploads/default/d6099d5e1438bca7acf21f46fe99bdce1ededf9a" title="image">[image]</a>
I am currently reorganizing and renaming my macro groups , renaming them about 20 macro groups at a time (I have many).
Is there a way to modify the macro to allow me to rename search replace macro groups instead of macros ?
thanks in advance for your time and help
[KM] Rename Macros with RegEx S&R.kmmacros (7.1 KB)
batch rename macros (click to expand/collapse)
Something like this?
Group Regex Rename.kmmacros (3.2 KB)
Image
It's working for me -- but I won't pretend to have tested against every conceivable macro group name, so use with caution until you are happy with it.
1 Like
I will do multiple backups and test your macro. thanks very much !!
ronald
September 14, 2025, 2:33pm
4
I want to delete the first 3 characters of each selected macro with your excellent macro.
The following does not work. Would you have any idea why ? My regex must be wrong.
thank you very much
^.{3}
replace with nothing
neither does this
(?m)^\d{3}\)
Nige_S
September 16, 2025, 2:29pm
5
The first one should work, as long as you leave the "Replace" field blank so you are replacing the first three characters with an empty string:
1 Like
ronald
September 16, 2025, 4:22pm
6
that's exactly what I did. I don't understand. thank you
is there any reason why it would not work with 12)abc and work fine with 12) abc ?
thank you very much
Nige_S
September 17, 2025, 10:17am
7
Both work fine here (remembering that the first probably needs ^.{3} for the search term, the second ^.{4}.
Otherwise, it's difficult to say until you explain what you mean by "would not work".
1 Like