Variable Set Boolean


A Boolean Variable holds either one of two values: True or False.



Script Editor > Expand Variables Category > Variable Set Boolean



Which command would you like to use:

Select the If command to use with the Set Boolean command. When the macro is run, the If Statement either returns a value of "Yes the statement matched" or "No the statement did not match". If the statement matched then it produces a value of "True" in the Boolean Variable. If the statement did not match then a value of "False" is saved to the Boolean Variable.



Boolean Variable

Select the Boolean variable to receive the results.



Sample Macro

Let's look at a quick example using the If Mouse Cursor option as shown in the image above. The Boolean variable was assigned the name of "Bool". The If Mouse Cursor option looks for an Arrow cursor.


For this example, first assume that the macro saves a large file. While the file is saving, the mouse cursor displays as an Hourglass. We don't want the macro to resume until the file has finished saving. The Hourglass changing back to the Arrow indicates that the save has finished.


In the macro script shown below, the Repeat Until command runs in a loop until the value of "Bool" equals True. Based on how we defined the variable in the Variable Set Bool command, "True" signifies that the mouse cursor is an Arrow. When the file save has finished, the mouse cursor returns to an Arrow and the True condition is met. The Repeat loop terminates and the macro continues.


Macro Script

<Macro commands to save file>

Repeat Until %Bool% Equals True

  Variable Set Bool: %Bool%

End Repeat

<Macro commands after file is saved>