On the wiki page for plug-ins lists 2 methods for retrieving Keyboard Maestro plug-in parameters from the environment variables, a 3rd way probably needs to be added.
Use AppleScript set myText to System Attribute "KMPARAM_My_Text"
As noted this method is "not safe for international characters" (and emoji)
Use set myText to do shell script "echo $KMPARAM_My_Text"
This method works with emoji and international characters but multi-line text (as from a TokenText form field) will be flattened into a single line
use set myText to do shell script "printenv KMPARAM_My_Text"
This works with emoji, international characters and multi-line text however printenv returns an error if KMPARAM_My_Text doesn't exist. You can catch this error with a try command. Final result:
try
set myText to do shell script "printenv KMPARAM_My_Text"
on error
set myText to ""
end try
Looks pretty good. I didn't know about the zip install method. I was just looking at how to get GitHub to automatically create a new zip for downloading whenever I push an update. Once I figure that out I'll update my instructions. (Does it also work with updates? If I drag a zip onto the KM icon will it overwrite the existing?)
Not sure how much you want to get into debugging but for the Reload commands at the end, you can put that reload right in the your test macro right before calling your PIA and it will kick in the new code immediately and the macro will keep running.
On the parameters for the #3 printenv option you have "on error -- Parameter does NOT exit" I assume that last word should be exist?