Set Variable Branch Conditions in a Script
Branch condition are found in the Properties window for most of the Studio script actions. The Properties window is accessed by either right-clicking a Studio action in the canvas or by clicking an action in the canvas and then clicking the Properties tab. Either way, you can see the Branches section at the bottom of the Properties window:
Most of the Studio actions show their branches in the Properties window, as shown in the previous image. However, some of the images use variable branch conditions to set a specific value to a branch. For example, when you encounter a menu in a script, the menu may say, "Click 1 for X, click 2 for Y, or click 3 for Z." The 1, 2, and 3 values in the menu are the variable branch conditions. The following image shows the variable branch conditions in a script:
These variable branch conditions are set when you drag a connector from the action that sets the condition to another action. In the example above, that would be to drag the connector from MENU to each of the three PLAY actions. When you complete each connection, the Pick Branch window will appear with the Variable Branch Conditions section:
To add a branch condition, you will click the Plus sign, which will create an editable field in which you can add any value as the branch condition. Click OK, and you will see the value you entered display on the connector between the two actions:
-
Drag a Studio action with variable branch condition to the canvas.
Studio actions that include variable branch conditions are MENU, ASRMENU, PAGE, and CASE.
-
Drag another action to the canvas:
-
Connect the action from Step 2 to the action in Step 3:
-
When the Pick Branch window appears, click the Plus Sign:
-
In the field that is automatically added, replace the default value (new) with a user-defined branch value:
For example, you could replace the default value "new" with a value of "1."
-
Click OK.
You will notice the Variable Branch Condition value that you have added will appear on the connector between the two actions:
You can create and connect as many variable branch conditions as you need. Just remember that when your conditions are done, you will need to set the properties in the actions that you've connected. Using the example above, you would right-click REQAGENT and set the properties: