How Can We Help?
< All Topics

Defining Variables in Macro Express Pro

When entering certain commands in the Script Editor, Macro Express Pro does not attempt to determine whether or not something entered is a variable. For example, if you enter %Variable% into a Text Box Display command it does not ask whether you want to create a variable. But when the macro runs, if a variable named %Variable% is found, the content of the variable is displayed. If the variable is not defined then the string %Variable% is displayed.

Other commands require a variable and Macro Express Pro will prompt you to create a new variable. For example, when you enter a Variable Set String command, if the variable you enter does not yet exist, the create variable prompt will be displayed.

You may, if you wish, disable the create variable prompt. With the create variable prompt disabled you can either create variables by clicking the ‘Add’ button on the Variables tab or have Macro Express Pro automatically create them for you.

Do the following to disable the create variable prompt and not have Macro Express Pro automatically create variables:

  1. Make sure the ‘Prompt the user to create a variable that is not defined’ setting found in Options, Preferences, General and the Dialogs tab is enabled.
  2. Edit or create a macro.
  3. Add a macro command, like Variable Set String, that will prompt you to create a variable.
  4. Check the “Don’t show this again” option.
  5. Click the No button.

Macro Express Pro will remember the “No” and “Don’t show this again” selections. You will be responsible for creating any variables used in your macros.

Do the following to disable the create variable prompt and have Macro Express Pro automatically create variables:

  1. Make sure the ‘Prompt the user to create a variable that is not defined’ setting found in Options, Preferences, General and the Dialogs tab is enabled.
  2. Edit or create a macro.
  3. Add a macro command, like Variable Set String, that will prompt you to create a variable.
  4. Check the “Don’t show this again” option.
  5. Click the Yes button.

Macro Express Pro will remember the “Yes” and “Don’t show this again” selections. When you enter a macro command that uses a variable the program will attempt to automatically create a new variable. Note, however, that some macro commands accept more than one type of variable such as a String, Integer or Decimal.

Macro Express Pro will try to guess what type of variable is needed but it may guess wrong. It may create a string variable when an integer variable is needed. When this occurs a warning will be displayed when you run the macro and you will need to delete the incorrect type of variable and add the correct type of variable using the Variables tab.

Applies to: Macro Express 5 and Macro Express Pro