-var varname

From iMacros
Jump to: navigation, search

Assigns a value to the user-defined variable varname during replay of a macro. It does not work with any of the built-in variables.

If values include whitespaces then please replace them with [SP] or enclose the entire value in double-quotes. Linebreaks in command line options should be replaced by the [BR] command.

Value

Any character or series of characters.

Examples

imacros.exe -macro test1 -var_LASTNAME Schaefer  -var_FIRSTNAME Peter

Note that the name of the variable after the "var_" prefix must correspond to the variable name used in the macro. The example above will assign the value "Schaefer" to the variable "LASTNAME", and "Peter" to the variable "FIRSTNAME" when running macro "test1".

' test1.iim
PROMPT "Hi, my name is {{FIRSTNAME}} {{LASTNAME}}"

Two ways to set a variable value that contains spaces:

imacros.exe -macro test2 -var_fullName Peter[SP]Shaefer
imacros.exe -macro test2 -var_fullName "Peter Shaefer"

See Also

iimSet()