Help passing TriggerValue from Remote Trigger

I'm wanting to use a remote trigger from an Android phone, and pass the TriggerValue at the end of the URL

For example the (truncated) URL run from the Android phone could be something like

https://trigger.keyboardmaestro.com/…-51E85E40D1AB?bananas

Then in the Keyboard Maestro triggered macro I'm wanting it to grab the TriggerValue and pass it to the AppleScript.

The end result would be to add "bananas" to my Shopping list in Reminders.

tell application "Keyboard Maestro Engine"

	set theItem to getvariable "TriggerValue"

end tell


tell application "Reminders"
	
	tell the list "Shopping"
		make new reminder with properties {name:theItem}
	end tell
	
end tell

I'm hoping this is something simple that I'm missing 🙂

Use a macro with the Remote trigger.

When the macro is executed, the TriggerValue token will contain the “bananas” parameter passed with the URL.

To get it via AppleScript you will need to store it in a variable.

Note that TriggerValue is not a variable, it is a Token.

You should not use a variable named TriggerValue, that will just be confusing.

1 Like

Note that TriggerValue is not a variable, it is a Token .

You should not use a variable named TriggerValue, that will just be confusing.

Ah, I was getting mixed up. Thinking %TriggerValue% was a variable :blush:

To get it via AppleScript you will need to store it in a variable.

Would I store it as a variable somehow from the web trigger URL? If not, how should I store it as a variable to be used in the macro to add to Reminders?

Set Variable instance_MyNewVar to %TriggerValue%

-rob.

2 Likes

Perfect, thank you!