AppleScript – Using Keyboard Maestro Variables in AppleScript.
JavaScript for Automation – Provides an introduction to JXA and comparison with AppleScript. Using Variables in JXA
Shell Scripting – Using Keyboard Maestro Variables (TBD)