Locator: Automator > Edit Script > Edit Script .
The Script summary is displayed on the right inside the Automation Steps group box. Set Script values using the Script Editor controls as follows:.
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.
Automation Steps can be any of the following types:
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.
Process Steps as Announcements - These checkboxes designate that the Script is an Announcement Script and all its Play Steps are treated as Announcements. See the separate page on Announcements with Music Programming.
See Figure 2. Only Scripts that have their Schedule Enabled will be added to the Schedule Plan when the Scheduler is started.
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 child 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.
Listing 1. Master ScriptScript Name: Pre-show Music Master Steps: 1. Run Script (My-Announcements) 2. Run Script (My-Playlist)
In the case of Listing 1 above, you have a parent script ('Master Script') that starts two child scripts.
Listing 2. Stopping the Parent Script and Its ChildenScript Name: Stop Master Script Steps: 1. Stop Script (Pre-show Music Master)
Listing 3 - Using the Scheduler to stop music programming at 5:00:00 PM.
Listing 3. Stopping One Child ScriptScript Name: Stop Music Playlist Sched: At 5:00:00 PM Steps: 1. Stop Script (My-Playlist)
If you want to run two scripts concurrently (at the same time) using Run Script steps, you apply a Timed Offset of zero (:00, see step#1 in Listing 4). However, if both scripts contain Play steps, that can interfere with how steps advance. To prevent interference between the two Scripts, apply the Spawns New Thread attribute to one of the Run Script steps in the Step Editor.
Listing 4. Run Two Scripts ConcurrentlyScript Name: Run Two Scripts Concurrently Steps: 1. Run Script (Zone-1 Music Playlist), Offset: :00, Spawns New Thread 2. Run Script (Zone-2 Music Playlist)
When you select a script in the Automator (ex. Parent-Script, Listing 5) and click the Run button, then Parent-Script runs as a Parent script. If Parent-Script has a RunScript step to start My_Playlist, then My_Playlist starts as a child of Parent-Script.
Listing 5. Parent/Child ScriptsScript Name: Parent-Script Steps: 1. Run Script (My_Playlist)
Listing 6. Pause a Child ScriptScript Name: Pause-My_Playlist Steps: 1. Pause Script (My_Playlist)
Required Option - A new Option was introduced in v.r 3.38 (Apply Stop/Pause/Resume To Child Scripts) to expand the scope for Stop-Script/Pause-Script/Resume-Script step commands. This includes scripts running under the Scheduler. This provides better functionality for scripts and is the recommended option. The legacy behavior did not allow for Stop/Pause/Resume of child scripts. This new option will provide these actions for operating on child scripts. So for example, Pause-My_Playlist (Listing 6) can now find and pause My_Playlist which is running as a child of Parent-Script.
When performed programmatically in a script, Pause/Resume is a special case. The Resume-Script step MUST be a timed step (either Offset Timed or Scheduled for a time-of-day). The reason is that when you Pause a script, it stops executing sequential steps until the script is resumed. Also, the 'Apply Stop/Pause/Resume To Child Scripts' must be enabled (checked) in the Automation Options for the following examples to work.
Required Option - A new Option was introduced in v.r 3.38 (Apply Stop/Pause/Resume To Child Scripts) must be enabled (checked) in the Automation Options for the following examples to work.
Listing 7 shows an example of Pause/Resume for the Scheduler. The Scheduler paused 30 minutes after the script starts. When the scheduler is paused, the My_Playlist Script is paused. Then at the 1 hour mark the Scheduler is resumed. In this way a Script or the Scheduler can be Paused/Resumed multiple times.
Listing 7. Pause/Resume Scheduler by Offset TimeScript Name: Pause/Resume Scheduler Sched: Period: 24 Hours Steps: 1. Scheduler (Pause), Offset: 30:00 2. Scheduler (Resume), Offset: 1:00:00 3. Run Script (My_Playlist)
Listing 8 shows an example of Pause/Resume for a Script. It has the same timed behavior as Listing 7 above.
Listing 8. Pause/Resume a Script by Offset TimeScript Name: Pause/Resume Script My_Playlist Steps: 1. Pause Script (My_Playlist), Offset: 30:00 2. Resume Script (My_Playlist), Offset: 1:00:00 3. Run Script (My_Playlist)
Listing 9 shows an example of Pause/Resume for the Scheduler. The Scheduler is paused at noon time (12:00:00 PM). When the Scheduler is paused, the My_Playlist Script is paused. Then at 1PM the Scheduler is resumed. Finally at 5PM, the Scheduler is stopped which ends My_Playlist playback. In this way a Script or the Scheduler can be Paused/Resumed multiple times.
Listing 9. Pause/Resume Scheduler by Scheduled TimeScript Name: Pause/Resume Scheduler Sched: Period: 24 Hours Steps: 1. Scheduler (Pause),Sched: At 12:00:00 PM 2. Scheduler (Resume), Sched: At 1:00:00 PM 3. Scheduler (Stop), Sched: At 5:00:00 PM 4. Run Script (My_Playlist)
Listing 10 shows an example of Pause/Resume for a Script. It has the same timed behavior as Listing 9 above.
Listing 10. Pause/Resume a Script by Scheduled TimeScript Name: Pause/Resume a Script Steps: 1. Pause Script (My_Playlist), Sched: At 12:00:00 PM 2. Resume Script (My_Playlist), Sched: At 1:00:00 PM 3. Stop Script (My_Playlist), Sched: At 5:00:00 PM 4. Run Script (My_Playlist)
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.