You can automate playing Media Items by building automation Scripts (Scripts) . A Script is composed of one or more command Steps (Steps) which execute in sequence or can be timed to fire at a specified time. You can run a Script manually by pressing Run Script button in the Automator window (Figure 2.). Or Scripts can be run at a specific time of day by starting them with the Scheduler. To get started with Scripts, read this page , then look at the Script samples .
Automation Scripts have the following behavior:
Automation Steps include the following types.
* End Processing Steps - These steps can be used to provide clean-up at a scheduled time or after a specified expired time duration (offset timed). Execute the "Unload All Screens" step before the "Halt All Scripts" step when using the two together. See script sample for more usage detail.
See the Script Editor for details on how Steps are added to a Script.
In most cases, you should NOT use a Load step before a Play step (Sequence A below). In fact it is less efficient than simply performing just a Play Step. And the combination (Load+Play) can cause timing issues in some cases -- The Load may not complete before the Play step is executed resulting in unpredictable behavior. Only use a Load step in cases where you want to open a Media Screen frozen on frame one, then perform the Play step at some later time.
Load + Play Sequence A - Avoid: Load(video1); Play(video1); Load(video2); Play(video2)...
One of the efficiences of using Load Templates is that a template Media Screen gets reused for each subsequent Play step.
As a rule of thumb, rather than using a sequence like this. A - Avoid: Play(video1); Unload (video1); Play(video2); Unload (video2); Play(video3); Unload (video3)... Simply use this. B - Better: Play(video1); Play(video2); Play(video3)...
Sequence A, will cause the template Media Screen to be destroyed with each unload and rebuilt with each Play step. This will result in a noticable delay between video plays.
Script Steps execute in one of two modes. When Offset Time is NOT enabled, the Step is treated as a simple sequential Step.
A Media Item MUST be loaded to a Media Screen before it can be referenced by any Script Steps. It can be loaded either manually from the Media List Editor or by a Script Load Step. If you attempt to execute a step that references an unloaded Media Screen, you will see a "Load missing" error message and the step will be skipped. See the Log file messages when unexpected results occur.
Load Time of a Media Item is not predictable and is based on multiple factors: Speed of the computer and CPU usage by other running programs; Size of media file; Media formats (low resolution vs high definition formats); Codec that does the decompression of the media; Media file physical location (remote/Web vs local machine file) and other variables. A Load step will generally take up to a few seconds to create a visible Media Screen on the display. The amount of time it takes for the media to open and be ready for play will take additional time and will vary based on the factors mentioned above.
When a Media Screen is already loaded, and a Load Step for the Media Item is executed, it is simply ignored. It will not affect the playing status of an existing Media Screen.
For large videos (ie large file size), it is a best practice to Unload the Media Screen after it finshes playing. This frees up RAM memory.
The Automator will wait to recieve an End Of Media signal before proceeding to the next sequential step. An End Of Media signal implies that the end of the audio or video has been reached.
The Automator simply starts playing an Offset-Timed Play step at its specified time interval. It has no effect on execution of sequential steps. The Automator will wait for all playing Media Items to finish before completing a script run.
Multiple Scripts can run concurrently (at the same time). If two Scripts reference the same Media Screen, they may interfere with each other depending on the timing of these Scripts. For example, consider the case of two Scripts containing this step: Play Video1. When Script1 executes this step, the Video1 Media Screen will start to play Video1 from position 00:00. When Script2 executes this step, the Video1 will restart play at position 00:00 (effectively rewinding it to the beginning). If you want to have Video1 play in multiple Media Screens, simply create two duplicate Media Items that have Video1 for the media file.
Static Image files (Jpg, Png, etc) and Text Screens do not have an inherent time duration (length) like video and audio. See Default Image Text Screen Duration for rules on how a time duration is determined.
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 5 seconds into the delay, there will be 15 seconds of delay remaining once you click Resume.
If you click Pause while Offset-Timed Steps are waiting to execute, the execution time of these steps will suspend until the script is resumed. For example, if you have a Play step that is Offset-Timed to execute 10 seconds after the script starts, and you click the Pause button 5 seconds after the script starts, when you click Resume button there will still be 5 seconds of wait time before the Play step is executed.
Any number of Scripts may run simultaneously. However, only one instance of a given Script can run at a given time. So for example if Script-A and Script-B are running and Script-B tries to execute a Step Run Script(Script-A), the Automator will see that Script-A is already running and ignore the Step.
A Run Script Step will start another Script to run. However, a Script should not contain a Run Script Step that starts itself. It will be ignored due to the Single Instance Rule above.
If a Script is detected repeating itself rapidly in a very short time span, the Automator will assume it is in a Runaway
condition and abort it.
Under certian conditions, you could create a Script that spins out of control, repeating itself as rapidly as your CPU can process it. This is usually associated with a Script set to Loop or Repeat and composed of timed Steps (ex Offset Timed Steps). The Script Editor detects and warns about obvious cases, but not all problems can be detected at edit time.
If a Script is detected as running in an infinite Recursion loop, the Automator will abort it.
This can happen if you are not careful with 'Run Script' Steps in your Scripts. For example, if you run Script A in Listing 1, it would cause a Recursion loop (A runs B; B runs A; A runs B; ad infinitum...).
If not stopped, the two Scripts would continue to run each other until the computer runs out of memory.