I'm not Dan, I'm not even mini-Dan, but there is a page in the wiki that I've been reading lately that lets use separate strings as separate parameters into a macro:
https://wiki.keyboardmaestro.com/token/TriggerValue
...which says:
You can easily access the individual parts using the token array notation, eg
%TriggerValue[3]%
will be the third comma-separated value, and%TriggerValue[3];%
will be the third semicolon-separated value, and%TriggerValue[3] %
(note the space between the]
and the%
) will be the third space-separated value (8.0.4+).
I've never tried passing a dictionary as a parameter (which is what I think you mean by "map".) Interesting idea. So I think we can all agree that a JSON is just a string so we know can pass one (if it's a constant) to a macro like this:
And that might be good enough for your purposes.
But a deeper question is whether we can pass a JSON to a macro as variable name rather than a constant. I couldn't see how to do it (maybe someone else can) but I was able to trick it by doing this:
And that worked, as long as the dictionary that I wanted to pass as a parameter was a dictionary called "a" inside a dictionary called "MyDictionary." That opens up interesting new possibilities for me! I never knew you could do this! This is huge! Thanks for making me think about this.
The only thing is that this is still passing the information by value, not by name, so the macro can't modify the data in the dictionary. However this could be fixed by passing the name of the dictionary and its sub-dictionary as additional parameters, like this:
I think I could get that to work.
Passing a variable "by name" might also interest you and was discussed two years ago here: