Variables are simply strings. Always. Plain text strings and nothing more.
Keyboard Maestro has to deal with things like points and rectangles and so Keyboard Maestro allows a string that consists of a sequence of numbers separated by commas to be considered points or rectangles as appropriate.
Variables in that format can be referenced as arrays, as in “Var”. So if Var holds “10,20,30,40”, Var would be 30.
To simplify the use of rectangles and points, there is also a dot notation where you can use Var.top which is exactly equivalent to Var. The possible values are:
- x (1)
- y (2)
- left (1)
- top (2)
- width (3 or 1 - depending on whether there are 2 or 4 elements in the array)
- height (4 or 2)
- right (Var.left + Var.width)
- bottom (Var.top + Var.height)
- MidX (Var.left + Var.width / 2)
- MidY (Var.top + Var. height / 2)
- fuzz (5)
But they are all internally defined, you cannot define your own.
To pass more than one parameter, pick a character (or string if necessary) that is not used in your text and concatenate them that way.
Comma’s obviously work for some simple cases. If you text needs comma’s in it, then perhaps bullets (Option-8 •). Failing that, you can use some unique string like “,KMSEP,”. Use the Search Variable acton to break the parameter apart.
Or alternatively, just define the input variables. All variables are global. And yes, in programming, global variables are generally bad and all that, but we’re not building operating systems here.