Modify macro duplication applescript to add "copy " to the end of the macro name

The following AppleScript by the excellent @Zabobon duplicates a macro defined by its UUID and I use it a lot.

The only issue I have run into is that its not possible to differentiate visually the original from the copy. is there a way to add "copy" to the end of the duplicate’s macro name ?

thank you very much

set kmInst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
	set templateMacro to getvariable "LOCAL__TemplateMacroUUID" instance kmInst
end tell

tell application "Keyboard Maestro"
	activate
	set macroList to duplicate (macro id templateMacro)
	set macro1 to item 1 of macroList
	set duplicateMacro to id of macro1
	editMacro duplicateMacro
end tell
1 Like

Try adding this line just after the set macro1… line:

set name of macro1 to (name of macro1) & " copy"

In theory, that should work :).

-rob.

2 Likes

great !! works perfectly. thank you very much !

1 Like