Local variables and dictionaries with custom HTML prompts

When I attempt to access Local or Instance variables in custom HTML prompts, they do not seem to return results.

Example:

window.KeyboardMaestro.GetVariable("Local_SomeVar")

Also, is there a way to access dictionary key/value pairs in HTML prompts? It’s not hard to turn a dictionary into variables, or build from them, but it would be nice to have direct access. (Switching between dictionaries and variables is exactly why I’m trying to get local variables to work!)

They are also broke in Prompt for User Input. Peter has said he will fix.

I agree, we need this. It would also be great to have a Dictionary-to-JSON, and JSON-to-Dictionary function.

Custom HTML Prompts are in their own instance, so they cannot access local or instance variables.

Since Custom HTML Prompts can be executed asynchronously, those will never be able to access local or instance variables, but I should be able to make synchronous ones work at some point in the future.

Using window.KeyboardMaestro.ProcessTokens you can get dictionary values.

I will look at adding direct dictionary support to Custom HTML Prompts.

1 Like