I want to use one variable as a value list and cycle another variable through those values.
EX.
Set VALUES variable to be "AFEH".
And then iterate the variable VALUE through the values A,F,E,H,A,F,E,H...
Thanks in advance!
I want to use one variable as a value list and cycle another variable through those values.
EX.
Set VALUES variable to be "AFEH".
And then iterate the variable VALUE through the values A,F,E,H,A,F,E,H...
Thanks in advance!
Hey Mike,
Probably the simplest method for that task is something like this.
-Chris
@ccstone' s is a good solution if you want to loop through each value in the cycle within a macro run.
For a slightly different context, in which you want a variable to take on the next cycle value on each separate macro run, you could take advantage of the indexed %JSONValue%
tag, which gives you lists:
0
allowing for expressions like:
So, for a macro which increments its cycle index value on each run, we might write things like:
Next value in a cycle.kmmacros (22.7 KB)
PS if you need to define run-time conversions of the pattern:
AFEH -> ["A","F","E","H"]
you can write things like:
Plain string to comma delimited JSON list format.kmmacros (19.5 KB)
-->
Yes, that is what I meant. The next value each time the macro is run. Awesome!