An expression is a series of value elements (variables or constants) combined with operators, which yields a new value. The operators act on the value elements by performing calculations, comparisons, or other operations. The most actions in Macro Expert support the expression to instead of the fix parameter value. It gives a macro more flexible - the macro has an ability to handle the different data every time the macro launches.

Using Expressions

To use an expression in the action, simply enclose the expression by percentage signs, and use the equal mark to lead, like this:
%=1+2%, %=5 * VARIABLENAME% (substitute VARIABLENAME for the variable name you used.)


The equal mark could be ignored if the expression does not include the operator, for example,

Special characters

Certain characters have special meaning in the expression, such as the percentage sign, the single quotation mark. In order to use these special characters as literals in an expression, they must be specified by using the syntax \x.

\%Percentage sign%="100\%"+"abc"%.
\nNew line%="hello\n"%.
\rCarriage return%="hello\n"%.
\tTab character%="No.\t\Name\tAge"%.
\'Single quotation mark%="It\'s an example."%.
\"Double quotation mark%="She said: \"No\"'%.
\\Backslash%="c:\\my document%.


  • In the action dialog, the icon on the side of a parameter field does mean it supports the expression.
  • The special character representations are available only in the experssion.
  • A datatime value in memory is same as the struct SYSTEMTIME in Windows API.
  • A number in memory is same as the double-precision floating-point numbers.

Additional References