Here is a semi functional macro I whipped up to quickly add and remove text from macro names. It's missing a ton of functionality but it does what I needed it to do. I'll post an updated version when I make improvements.
Carefully review the Release Notes and the Macro Actions
Make sure you understand what the Macro will do.
You are responsible for running the Macro, not me.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set searchTerm to getvariable "Local__Search" instance inst
set replaceTerm to getvariable "Local__Replace" instance inst
end tell
tell application "Keyboard Maestro"
set macroList to every macro whose selected is true
repeat with aMacro in macroList
set oldName to name of aMacro
set newName to change searchTerm into replaceTerm in oldName with regexp without case sensitive
set name of aMacro to newName
end repeat
end tell
Replace the AppleScript in the above Macro with this:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set searchTerm to getvariable "Local__Search" instance inst
set replaceTerm to getvariable "Local__Replace" instance inst
end tell
tell application "Keyboard Maestro"
set macroList to every macro whose selected is true
repeat with aMacro in macroList
set oldName to name of aMacro
### Next statement requires Satimage.osax -- not compatible with Mojave+ ###
--set newName to change searchTerm into replaceTerm in oldName with regexp without case sensitive
### Use KM Engine Replace Command ### @JMichaelTX 2020-01-14
set newName to my kmReplace(searchTerm, replaceTerm, oldName)
set name of aMacro to newName
end repeat
end tell
on kmReplace(pFindStr, pReplaceStr, pSourceStr)
tell application "Keyboard Maestro Engine"
set newStr to search pSourceStr ¬
for pFindStr ¬
replace pReplaceStr ¬
regex true ¬
without case sensitive
end tell
return newStr
end kmReplace