A selection command is a type of CueScript command that is used to refer to objects in the system.
Selection commands can be used in conjunction with action commands to perform actions, or selection commands can be used by themselves to query an object’s value.
Selecting Objects To Perform Actions
As CueScript is being interpreted by the system, selection commands are used in conjunction with action commands to get things done. First, one or more objects are selected by using a selection command, and then one or more action commands are used to operate on those selected objects.
For instance, the following CueScript does two things. First, it selects a button. Second, it performs the
Button 1 On
Note that the On action turns “on” the currently selected objects, which in this case happens to be Button 1.
The next CueScript selects playback number 3 with a selection command, then the action command
At 75 sets the playback’s submaster to 75%.
Playback 3 At 75
More than one action can be performed on a selected object. The following example shows the selection command
Channel 1 followed by four action commands:
Time 5, and
At 0. In other words, Channel 1 is selected, then the fade time is set to zero, then Channel 1’s value is set to 100%, then the fade time is set to 5 seconds, then Channel 1’s value is set to 0%.
Channel 1 Time 0 At 100 Time 5 At 0
Stringing multiple actions together that refer to the same selected object is a powerful way to express compound actions that you want to apply to one or more objects.
Referring To Objects To Determine Their Value
Another powerful way to use selection commands is to refer to one or more object to retrieve their value.
For instance, by executing the command:
CueServer will not only select Channel 1, but it will also reply with the current value of Channel 1.
Being able to ask CueServer the value of an object is very useful for evaluating expressions. Consider the following command:
If (Channel 1 > 50) Then Cue 1 Go
The If .. Then statement is used with the expression Channel 1 > 50 to make a decision based on the current value of Channel 1. If the value is greater than 50, then Cue 1 Go will occur.
Referring To Multiple Objects With Different Values
When referring to multiple objects at once, if all of the objects have the same value, their shared value will be returned. For instance, if channels 1 through 10 are all set to 50, then the following command will return 50.
But, if the values of channels 1 through 10 have mixed values, then the value
-1 will be returned. This special value indicates that the selected objects’ values are mixed.