Variables are small stores used to keep track of various types of data. These data stores can be easily recalled and used in CueScript in any context.

There are a plethora of situations where variables can be helpful and multiple ways in which they can be used.

This article is here to help you determine what those situations might be and the multitude of ways they can be utilized.

For a more in-depth technical analysys on user variables, check out the variables section of the manual.

For more on System Variables, used for setting system parameters and settings, take a look at this section.

Types of Variables

System Variables

These variables are pre-set and used to manipulate system settings and properties.

An example of a System Variable might be audio.volume which is used to set CueServer's system output volume.

User Variables

These variables are defined by the user and are used to store small pieces of data, such as strings, numbers, channel ranges, commands and much more.

An example of a User Variable might be fixtureOne and used to store the value of ch1>3. The Use for this might be to recall a fixture's channel range quickly without the need to remember actual channel addresses.

Non-Volatile Variables

These variables are typical variables definded by the user, but with the non-volatile modifier.

Non-Volatile variables persist through reboots and show unloads, where standard variables are erased on such events.

Using Variables in CueScript

Setting a variable in CueScript is a breeze.

Use either of the three methods below to set a variable.

Method 1: Using the Equals Operator

Assign variable using equals operator

Simply surround the desired variable name with double quotes followed by an equals sign and the desired value.

Thats it!

Note: variables are case sensitive

Method 2: Using the Set Command

Assign variable using set command

To use the Set method, no quotations are required.

Simply preface the variable name with the set command (See image to the Right)

Note: variables are case sensitive

Method 3: Using CueServer Studio Interface

Assign variable using CSStudio Interface

To use the CueServer Studio interface method, no commands are required.

In the variables panel (located on the left-hand sidebar) click the + in the bottom left to add a new Variable and set the Name and Value using the provided fields (see image to the right).

Note: variables are case sensitive

Recalling a variable in CueScript is even easier than setting one.

Recall variable inline Recall variable inside of a rule

Anywhere in CueServer, call a variable's value into place using single quotes.

Channel 1 at 'myVariable'

Channel one is set to the numerical value of the variable myVariable

Back-Ticks can be used to recall a variable's value inline and execute it's contents as a CueScript Command.

Anywhere in CueServer, call a variable's value into place and execute it using back-ticks.

Set a variable like so:

"myVariable" = "channel 1 at 100"

Now we can execute this variable as a command like so:


Essentially, this method turns a variable into a sort of Macro, or User-Defined Function.

One reason this might be useful is in the event where you have a series of commands that are repeated throughout a show. This allows you to simplify the code and make future changes or blanket edits much more easily.

Try it Out!

Use the tool below to test out some example scenarios. Provide a variable name and value, then use the CueScript box to test out different uses and how they are interpreted by CueServer.

Variables in CueScript are used with "double qoutations", 'Single Quotations', or `back-ticks`.

Single Quote Example
Double Quote Example
Back-tick Example

Enter a variable and value below, then use the variable in the command box to simulate the interpretation of that command.
(Alternatively, use one of the preset example buttons above)

How it's Interpreted:

Complete Form for interpretation