I love that hack ! Here is the result:
I know, I could have extracted the path and generally made it better but I'm an AppleScript noob.
tell application "Keyboard Maestro Engine"
set KMVAR_classetag to do shell script "echo $KMVAR_classetag"
set snd_cmd to "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><array><dict><key>DeviceID</key><string>AppleHDAEngineOutput:1B,0,1,1:0</string><key>MacroActionType</key><string>PlaySound</string><key>Path</key><string>/Users/darcher/Downloads/classe-am/" & KMVAR_classetag & ".mp3</string><key>TimeOutAbortsMacro</key><true/></dict></array></plist>"
do script snd_cmd
I tried to do:
set KMVAR_classetag to getvariable "KMVAR_classetag"
instead of using a shell but it didn't work.
Anyway, it works great. Thanks @JMichaelTX