Get (yes) / set (?) selectedMacros

It is quite easy to get UUID/name of multi selected macros or groups in KM with such AppleScript code (inside or outside a KM macro):

tell application "Keyboard Maestro"
	set uids to get selectedMacros
end tell
set lst to {}
tell application "Keyboard Maestro Engine"
	repeat with uid in uids
		set end of lst to {(process tokens "%MacroNameForUUID%" & uid & "%"), contents of uid}
	end repeat
end tell

How to do the reverse i.e. set selection of some macros or groups in KM?

– Alain

You can use the editMacro AppleScript command to edit a single macro. There is no way to select a set of macros.

As I just want to select (not exactly edit) (although I can't have or preserved multi selection) the things are a little more tricky:

select a Group-Macro.kmmacros (4.5 KB)

tell application "Keyboard Maestro Engine" to set n to process tokens "%tmp%"
tell application "Keyboard Maestro"
    set r to get running
    editMacro n
end tell