This is a simple test macro to attempt to set the value of a variable (foo), where the variable name is specified by indirection from an array of text values.
It's abstracted from a complicated workflow that we have been using successfully for a number of years.
Set Variable by Indirection Test.kmmacros (4.0 KB)
The expected result of running the macro is that the variable "foo" is assigned the value "bar".
I have tested the macro in version 10 of Keyboard Maestro and the test macro works. However, in versions 11 and 11.0.1, the macro fails with an error message:
2023-11-10 13:06:26 Set Variable to Text failed to set variable “(null)” (from “%Variable%InstanceArray[1]:%”). Macro “Test” cancelled (while executing Set the Variable to the Listified Numbers).
Notes:
-
The variable name is obtained from a text array with a colon as a custom delimiter.
-
The disabled "Display Text" step, when enabled, correctly reports the variable InstanceArray[1]: as having the value "foo". This is in both versions 10 and 11.
-
The manual page for Set Variable to Text appears to indicate that all that is required for a variable to be specified by indirection is to enter, in the Set variable field of the Set Variable to Text step, a token that resolves to the name of the variable to be assigned.
Has anything changed in Version 11 that might cause the observed behaviour?
Does anyone know how I can modify the macro so that it works in version 11?
Thank you for any help you may be able to provide.