Integration Script: Keyboard Maestro Editor

A script to hook to Macros, Macro Groups, and Smart Groups in the Keyboard Maestro Editor.

I found the keyboardmaestro://m= url scheme wasn’t jumping to the selected item when the Editor was closed so I added an Open Item script that waits for the editor to activate.

Demo:

Get Address:

tell application "Keyboard Maestro"
	set s to selectedMacros
	if (count of s) is less than 1 then return
	set uuid to first item of s
	if exists (macro id uuid) then
		set n to name of macro id uuid
	else if exists (smart group id uuid) then
		set n to name of smart group id uuid
	else if exists (macro group id uuid) then
		set n to name of macro group id uuid
	end if
	return "[" & n & "](keyboardmaestro://m=" & uuid & ")"
end tell

Open Item:

set kmUrl to "$0"
tell application "Keyboard Maestro"
	activate
	repeat until frontmost
		delay 0.3
	end repeat
end tell
do shell script "open " & kmUrl
5 Likes

Thanks @keith.adams for providing the scripts :+1:

2 Likes