User Tools

Site Tools


trigger:Public_Web

Public Web Trigger

The Public Web trigger makes a macro available without further authentication via the Keyboard Maestro web server. See Set Setup and Use of Web Server.

The Public Web Trigger is one of several triggers that use a URL. See
Macro Triggers that Use a URL, 2018-07-15, peternlewis

Any macro with the Public Web trigger can be triggered by anyone without the username or password, assuming the Keyboard Maestro web server is enabled, and assuming they can connect to your Mac (which is usually anyone on your local network, but depends entirely on how your network is configured).

Public Web Trigger on a Macro

To Execute a Specific Macro

snippet.html
https://localhost:<Port+1>/action.html?macro=<YourMacroUUID>&value=<TheTriggerValueToPass>
or
http://localhost:<Port>/action.html?macro=<YourMacroUUID>&value=<TheTriggerValueToPass>
(by default, the <Port> is 4490, <Port+1> is 4491)

Security Caution

  • ⚠️ Note that this means anyone with Internet access to your Mac (which could be anyone, although it does depend on firewalls and NAT settings) can potentially trigger this macro.
  • So it should generally only be a safe macro, such as:
    • Restarting a service that is always supposed to be running, or
      • Launching iTunes or
      • Reporting or alerting you to something.
      • Some other fairly innocuous activity.
      • Clearly there are some serious security issues with this, so you should use a lot of caution when you allow any macro to be executed with a Public Web trigger.

      As with all triggers, macros are only available if they are currently active, that is if they are enabled and in a Macro Group that is enabled and active.

Examples

For example, if you are running some sort of process on your Mac that occasionally fails, you could write a script to restart it and make it available as a Public Web triggered Macro, which you (or anyone else) could then execute to restart the process.

For a complete example with a macro, see MACRO: @Web Open URL Passed from KM Public Web Server.

See Also

Triggers

Forum Topics

trigger/Public_Web.txt · Last modified: 2018/07/16 22:49 by JMichaelTX