Pass and set URL parameter as Variable value

Found a workable solution. Create a PHP script on the machine that accepts the variable from the URL then sets it as a Keyboard Maestro Variable using AppleScript:

http://localhost/script.php?input=value

<?php $myVariable = $_GET["input"]; exec('osascript -e \'tell application "Keyboard Maestro Engine"\' -e \'make variable with properties {name:"VariableName", value:' . $myVariable . '}\' -e \'end tell\''); ?>
1 Like