Count number of actions in a macro?

Is it possible to count the number of actions in a macro?

This script will return the number of TOP-LEVEL Actions:

tell application "Keyboard Maestro"
  set macroList to selected macros
  set oMacro to item 1 of macroList
  set numActions to count of actions of oMacro
end tell

return numActions
1 Like