Empty Parameter in a URL Trigger

This works:

kmtrigger://macro=C57DF299-A457-4455-B42C-A11A0A22B41D

This works:

kmtrigger://macro=C57DF299-A457-4455-B42C-A11A0A22B41D&value=foo

This doesn't:

kmtrigger://macro=C57DF299-A457-4455-B42C-A11A0A22B41D&value=

Is this by design ?

Could you please be more specific? What exactly does not work?

I'm not sure what information is missing. Except maybe to say that it feels like a bug, or rather an omission during KM development. That is to say, whatever the first two do, I can't think why there would be reason to specifically prevent the third from doing the same; hence, perhaps it just wasn't catered for.

Try it for yourself with any arbitrary macro that you can run safely and demonstrably to know that it has been run: get its UUID, construct three URLs that each resemble one of the three I supplied, and enter each one in Safari to discern whether it executes the macro.

  1. Is the target macro executed?
  2. If so, what is the value of the %TriggerValue%?

It is never sufficient to just say something does not work. If you want us to help you, then you always need to state exactly what is not working.

I, for one, am not going to bother testing until I know what I am testing for, looking for.

I think what CJK is pointing out is that an open ended parameter in the URL foils the caper.

In this case, the URL ends with &value= which should have some value assigned (eg. &value=potd). So you could test with any URL that has an empty parameter, like:

https://www.adorama.com/l/?searchinfo=

where searchinfo= should have some text.

@mrpasini, correct, except I was being specific about URL triggers, i.e. those that start with kmtrigger://, as a means to trigger a macro (which is the only thing they do).

I believe I stated this, but apologies for being abstract. I've reworded here:

Assertion: that a KM URL Trigger of the form kmtrigger://macro={UUID}&value= ought to successfully trigger the macro whose UUID is {UUID}, and that %TriggerValue% would be empty. Put another way, that kmtrigger://macro={UUID}&value= and kmtrigger://macro={UUID} ought to have identical functionality.

Test: Each of the three URL Trigger forms supplied initially in my OP were entered into the Safari search bar as one would an ordinary URL.

Expected Result: That the macro will be successfully executed in all three cases.

Observed Result: In all three cases, Safari appropriately requests permission to run Keyboard Maestro Engine. In the first two cases, the macro was successfully executed. In the last case, it wasn't, and no Engine.log entry was seen.

@peternlewis I hope you don't mind my tagging you in this post, either for enlightenment or as a feature request (albeit a small and not terribly important one).

You are correct, this is a bug. Fixed for the next version.

Thanks.

Fixed in Keyboard Maestro 8.2.2.

1 Like