4

Table Of Contents
The Script Editor opens and the Script Inspector appears.
3 In the Inspector, name the script Random Play.
4 In the Script Editor, select the first command line (Nop).
The Script Command Inspector appears.
5 In the Script Command Inspector, choose Set GPRM as the command.
6 To configure the set GPRM command:
a Choose “ran as the Operation.
b Choose Immediate as the Source Type.
c Enter 4 as the Source Value.
d Choose GPRM 0 as the Target.
The above settings generate a random number between 1 and 4 and place the value in
GPRM 0. It is this value that is looked at by the next commands in this script to determine
which track to play.
7 In the Script Editor, click the Add button.
The next command line is added to the script.
8 In the Script Command Inspector, choose Jump as the command.
9 To configure the jump command, choose Tracks and Stories > Ocean > Marker 1 from
the Jump To pop-up menu. This plays the first of the four tracks, depending on the result
of the compare function added next.
Note: Remember that the Ocean track is fictitious. Unless you created a track called Ocean,
you won’t see it in this pop-up menu.
10 Add a compare function to the jump command to test to see if this track has been selected
with the random generator.
a Select the Compare Command checkbox.
b Choose GPRM 0 as the “Execute if element to be compared to.
c Choose equal (=) as the “is” compare operation type.
d Choose Immediate as the “to element type to compare.
e Enter 1 as the “with value.”
If GPRM 0 has a 1 in it (generated by the random number generator command), this jump
command occurs. If not, the script moves to the next command.
519Chapter 20 Creating Scripts