Testing inside KM 7.0.2 (as Execute Text AppleScript action) these tokens
tell application "Keyboard Maestro Engine"
set v1 to process tokens "%TriggerBase%"
set v2 to process tokens "%TriggerValue%"
set v3 to process tokens "%ExecutingMacro%"
set v4 to process tokens "%ExecutingMacroGroup%"
set v5 to process tokens "%ExecutingMacroUUID%"
end tell
v1 & " " & v2 & " " & v3 & " " & v4 & " " & v5
seem broken… at least on my OS X 10.10 Yosemite system.
These are not really broken, they're just not available from AppleScript. (The AppleScript action doesn't see the Keyboard Maestro context.)
If you want to get those tokens INTO AppleScript you'll need to assign Keyboard Maestro variables to the tokens and then get the values of the variables into AppleScript.
In the macro below I'm doing this en mass, but you can do it piecemeal if you wish.
use framework "Foundation"
tell current application
set instanceCode to (its (NSProcessInfo's processInfo's ¬
environment's objectForKey:("KMINSTANCE"))) as text
end tell
if missing value is not instanceCode then
tell application "Keyboard Maestro Engine"
process tokens "%HTMLResult%" instance instanceCode
end tell
end if