Newbie Help creating a Plugin Action with JXA?

Here is a version of your action with a JXA script. You just need to use a shell script with osascript -l JavaScript to execute it:

#!/usr/bin/osascript -l JavaScript

var kme = Application("Keyboard Maestro Engine");
var varName = ObjC.unwrap($.NSProcessInfo.processInfo.environment.objectForKey("KMPARAM_Variable_name"))
var varValue = kme.getvariable( varName );
varValue;

Get the Value of a Named Variable.zip (5.5 KB)

1 Like