It could be that, but more immediately, Custom HTML Prompt
, like the Execute JavaScript in Browser actions, also decorates the document
object with a kmvar
property, which does entail reading every variable to assemble a JSON representation which is passed in at the head of the file.
My impression of window.KeyboardMaestro.GetVariable()
is that it accesses values in real time, so that (I haven't tested this), it's possible that the .GetVariable
method and the kmvar
property could return different values for the same variable name:
-
document.kmvar
certainly contains only values as they were at the moment of launching the action.
-
.GetVariable
may, I think, have real-time access to the value at a later point in time, when JS code evaluation (or other macros running in parallel) may have written updated values to one or more variable names. (The existence of .SetVariable()
suggests this picture to me).
Off-topic, I fear, but it would be helpful to have a clear picture of all this. It could be useful if .GetVariable()
access is indeed later than that of the kmvar
blanket pre-read.