Here's a modified script that will get only the ENABLED macros.
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/10/26 13:47
# dMod: 2023/03/22 17:56
# Appl: Keyboard Maestro Editor, Keyboard Maestro Engine, BBEdit
# Task: Export Names and Triggers of All ENABLED Keyboard Maestro Macros.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Keyboard_Maestro, @Keyboard_Maestro_Engine, @Display, @Names, @Triggers, @Keyboard_Maestro, @Macros
--------------------------------------------------------
property LF : linefeed
--------------------------------------------------------
set firstGroup to true
set macroCollatorList to {}
set AppleScript's text item delimiters to tab
tell application "Keyboard Maestro"
set macroGroupList to macro groups
repeat with macroGroup in macroGroupList
set macroList to (macros of macroGroup whose enabled is true)
if firstGroup is true then
set end of macroCollatorList to "MACRO GROUP: " & name of macroGroup & LF
set firstGroup to false
else
set end of macroCollatorList to LF & "MACRO GROUP: " & name of macroGroup & LF
end if
repeat with theMacro in macroList
tell theMacro
set end of macroCollatorList to tab & name & tab & description of triggers as text
end tell
end repeat
end repeat
end tell
set end of macroCollatorList to LF
set AppleScript's text item delimiters to linefeed
set macroCollatorList to macroCollatorList as text
set macroCollatorList to kmReplace("The Hot Key | is pressed", "", macroCollatorList, true, false, false)
set macroCollatorList to kmReplace(" +$", "", macroCollatorList, true, false, false)
bbeditNewDoc(macroCollatorList, true)
--------------------------------------------------------
--» HANDLERS
--------------------------------------------------------
on bbeditNewDoc(_text, _activate)
tell application "BBEdit"
set newDoc to make new document with properties {text:_text, bounds:{0, 44, 1920, 1200}}
tell newDoc
select insertion point before its text
end tell
if _activate = true or _activate = 1 or _activate = "activate" then activate
end tell
end bbeditNewDoc
--------------------------------------------------------
on kmReplace(findPattern, replacePattern, dataStr, regExBool, caseBool, tokensBool)
tell application "Keyboard Maestro Engine"
set foundDataList to search dataStr for findPattern replace replacePattern ¬
regex regExBool case sensitive caseBool process tokens tokensBool
end tell
end kmReplace
--------------------------------------------------------