Could I please ask anyone who has a working example to show it, along with a screenshot of the macro showing the entry in the remote trigger field, and maybe if anyone else has the same problem we could even add a working example to the wiki? I know it's probably embarrassingly simple, I just don't understand...
Edit: That syntax above isn't showing up correctly, UniqueID1 and UniqueID2 should also be a part of it but its seems to get trunctated in the post for some reason.
[Moderator Edit: 2018-07-15 02:07 GMT-5. Put the http code above in a html Code Block.]
@haptic, it's not you. This is a complicated topic, and the wiki was poorly written.
I have revised two related wiki topics, and if you have time, I'd really like to have your feedback on the rewrite. You can get links to the wiki articles, and post your comments, here: Wiki Update: Web Server and Public Web Trigger
Note these are still a work-in-progress, but I think they are complete enough for a review.
Hi @JMichaelTX, I reviewed the web server wiki, the Public Web Trigger one reads fine to me but it might be because I had already absorbed most of it from reading the first entry and getting it up and running.
Having digested some (not all) of this, I am left pretty amazed and also slightly confused. The web server and public web trigger methods for remote control of KM work well, but the URL Scheme Trigger is just so quick and intuitive and easy to use I think I will go with that. Having seen all this I'm left wondering what remote trigger can offer that the other methods can't? Also I still don't know how to get remote trigger working but thats not so much an issue now.
I know these methods are all different, but they seem to me to have a great degree of overlap. Which is no bad thing, KM is pretty powerful after all. Does this all seem pretty reasonable to you more knowledgeable types?
Ultimately my goal was to have my computer email me when something went wrong with my macros, and prompt me to make a call on whether it should restart itself and get back to work or not. So using this URL Scheme trigger I can in very few clicks do that. I'll just bookmark the URL address on my phone and click the icon when I want to set it off.
Sorry one other comment I have I can't seem to find an answer to-
why does URL Scheme Trigger give you four options?
Edit: No I am back in a land of confusion now- I assumed those 4 options would allow you to trigger the macro from any device anywhere but I can see that is not so because I tried it on my iPad and phone and neither worked.
They differ in a variety of ways, including security and remoteness.
The first three basically work only on your local Mac, and if you are triggering a macro from your local Mac, they are the ones to use. Which one depends on what you are doing on your Mac to induce it to be triggered. These have minimal security issues, since anything that can open files on your Mac, run AppleScript, or fire off URLs can almost certainly do a lot worse than running a macro.
The Public Web trigger works only if Keyboard Maestro’s built in web server is enabled, and for most people will work only within your local network, since almost everyone these days uses Network Address Translation and so you cannot access your Mac from outside your environment. Unless you don't have NAT (very rare), or you use a VPN or explicitly set up port forwarding, chances are you Mac cannot be executed from outside your own network. Thus these triggers are relatively secure, but can be accessed from elsewhere in your network (such as from your phone when you are also on your local network) or other Macs on your local network. Thus if you want access from elsewhere on your local network, this may well be the correct choice for triggering a macro.
The Remote Trigger works from anywhere on the Internet. It works via a http://trigger.keyboardmaestro.com/, which is a server that Stairways runs, and so Keyboard Maestro keeps a connection to the Stairways server, waiting for a trigger to come in, and you trigger it by accessing the Stairways server. These macros can thus be triggered from anywhere, so they have significant security implications. This is fine as long as your macro is relatively innocuous - for example I use it for displaying alerts if one of my systems goes down. If someone managed to trigger this macro the worst that happens is I get spurious alerts.
In theory, you can only trigger the macro if you know both the magic numbers in the trigger URL, which by default are UUIDs, so they have lots of random bits making them essentially impossible to guess. One is specific to your Mac, and one is specific to the trigger. Unless there is a need, you should use the random ones that Keyboard Maestro makes. However it is valid to have semi-public or public triggers, and multiple instances of Keyboard Maestro can have the same trigger, in which case all the different Keyboard Maestro’s with that trigger would execute the macro. For example, say you wanted multiple people to be alerted when some tickets go on sale, you could have single well known trigger value and anyone could trigger it all the Macs would be alerted. More likely you would use this in semi-public cases, say a macro for a bunch of Macs in a lab to tell them all to shut down.
In practice, if the Keyboard Maestro server was compromised, then any of the triggered macros could be triggered, so there remains additional risk on top of the secret trigger number being discovered. So it is a good idea to ensure the macros are innocuous.
The Keyboard Maestro web server has nothing to do with the Remote trigger - Keyboard Maestro’s web server does not even need to be enabled.
The Remote trigger works through our server (trigger.keyboardmaestro.com). So your Keyboard Maestro, on your Mac, when the trigger is active, will contact our server and register itself, and then stay connected, and when you use the link, the server will report the event to all the connected Keyboard Maestro’s with a matching trigger.
The fact that the URL is returning 0 means that the server does not know of any matching triggers.
So if the macro group is enabled, and active, and the macro is enabled, and your Mac can connect to the trigger.keyboardmaestro.com server, then it should work.