|
Create Variable Action |
Description
|
|
|
Parameters
Variable Name
This is the name of the variable to be created. It must be unique to this task (i.e. you cannot have two variables with the same name in the same task). You can then reference the contents of this variable in subsequent steps by enclosing the variable name is double exclamation points (for example, in the figure above, we are creating a variable called INDEX with an initial value of 0. To retrieve the number 0 from this variable in another step, we would use !!INDEX !!)Initial Value
The initial value to be stored in this variable. You can always change the contents of the variable later on using the Set Variable action, or through the scripting language or an inline expression.Hide Variable Contents
When checked, AutoMate will protect the variable’s contents in both the “Create Variable” dialog box (by replacing the visual text with asterisks) and in the task file (by encrypting the contents to avoid clear text contents from appearing in the file). Use this option if you require that the variable’s contents be hidden from view when editing or running the task. The variable contents are decrypted when the task is run.
Notes
Users of AutoMate™ Professional can also use the Create Variable function to create variables that are automatically passed into any scripts they run from a task. All AutoMate™ variables that are created using the Create Variable action before entering an AutoMate™ BASIC Script (by using the SCRIPT step) are available inside the script using its variable name. Any changes made to these variables are also automatically passed back to AutoMate™ when the script has completed. This allows great flexibility in your tasks, since data can seamlessly be exchanged between your executing task and AutoMate™ scripts.
An advanced feature of the Create Variable action, available only to users of the Professional version, is to use an inline expression to create “dynamically named variables.” Using this technique, you can create a variable name that is the result of an inline expression. For example, say we have a Create Variable step that creates a variable called INDEX with an initial value of 0. We then enter a loop set for 3 iterations, and inside this loop is another Create Variable step, which has its variable name parameter set to “NEWVAR!!INDEX+1!!” (without the quotes). When the loop exits, AutoMate™ will have created five new variables: NEWVAR0, NEWVAR1, and NEWVAR2.
Related Topics:
Populate Variable with Clipboard Action