Help icon product icon
Sound Mill X3 - User's Guide
          Go back Back to Table of Contents

Script Editor

The Script summary is displayed on the right inside the Automation Steps group box. Set Script values using the Script Editor controls as follows:.

General section

Add or Edit Automation Steps

In addition to editing individual Steps with the Step Editor, there are productivity buttons to change certian Step properties on multiple Steps at a time with just a few clicks.

Step Types

Automation Steps can be any of the following types:

Affect of Pause on Delay Times

If you click Pause while a Delay Step is in effect, the delay time will suspend (stop draining) until Resume is clicked. So for example, consider a 20 second Delay. If you click Pause after 5 seconds of the delay has expired, there will be 15 seconds of delay remaining once you click Resume.

Preemptive Play Steps

A Preemptive Play Step (a Step that plays a Preemptive Sound Item) added as a sequential Step is NOT allowed. The Step must be a timed step (Timed Offset step or Scheduled step). If it is not timed, it will be executed by the Automator as a sequential play step (but not preemptive). This condition will force a warning message from Script Validation and the Script Editor. There is actually no logical reason to configure a step this way.

Special Processing

Process as Announcements

Date/Time Scheduling a Script

See Figure 2. Only Scripts that have their Schedule Enabled will be added to the Schedule Plan when the Scheduler is started.

Figure 1.  Script Editor
Figure 1. Script Editor
Figure 2.  Schedule Section controls
Figure 2. Schedule Section controls

Script Threads

When you run a script by clicking the Automator Run button, a thread is created for script execution. If the script has Run Script steps (as in Listing 1), the scripts will run inside the parent script's thread. In this case, the master script thread can control both of the spawned scripts and coordinate the announcements with the music playlist.

There are cases when you might want to spawn a script into its own separate thread. In that case, you would mark a Run Script step with the Spawns New Thread attribute. Each thread would run concurrent (simultaneously) with other threads. This necessary for advanced scripting like when you want to pause and resume a script on a timed basis.

Listing 1. Master Script
Script Name: Pre-show Music Master

1. Run Script (My-Announcements)
2. Run Script (My-Playlist)

Figure 3. Scripts Threads
Figure 3. Scripts Threads


Caution! 1) If you delete a Sound Item from the Sound List and an automation Step references to that Sound Item, the automation Step will not execute. It will also be flagged as an error when you Validate the Script.

2) A Run Script Step cannot run the Script it is contained in. This will be flagged as a 'self reference' error. For example, Script A cannot contain a Step to Run Script A. This would create an infinite loop condition.

3) It is possible to create an infinite loop if you are not careful with Run Script Steps. For example, if Script A contains a Step to Run Script B; and Script B contains a Step to Run Script A. In this case, A and B will run each other infinitely and if not stopped with the Stop button will eventually cause the program to run out of memory.