Scripts, Using scripts with mbox, Applescripts – PRG Mbox Designer Manual 3.9 User Manual

Page 112: Shell scripts, Applescripts shell scripts

Advertising
background image

104

MBOX

®

MEDIA SERVER USER MANUAL

SCRIPTS

Using Scripts with Mbox

Beginning with Mbox v3.9, it is possible to trigger custom scripts. These scripts can be either AppleScripts or shell
scripts. The two types of scripts are created differently, but both types can be triggered identically.

Scripts are numerically indexed using an 8-bit prefix, just like other content on the server. Scripts must be placed in
the

/Mbox/plugins/scripts

folder. AppleScripts must use the file extension '.scpt' and shell scripts must use the file

extension '.sh'

001.Apple Script.scpt

or

123.Shell Script.sh

Scripts are considered metadata within the Mbox Content Management system. Beginning with Mbox v3.9, metadata
files can be sync'ed along with content (texture and object) files.

IMPORTANT! Scripts must be created outside Mbox using another application. They should always be tested outside
Mbox first, and then tested within Mbox before use in show situations.

AppleScripts

Use the AppleScript Editor application to create and test AppleScripts.

AppleScripts can be used to control many aspects of the computer and other applications running on the computer.
AppleScripts can also be used for external control, but require the script to trigger some other application for that
external control.

CAUTION!

In some cases, launching and performing tasks in some other application while Mbox is running, may

negatively affect Mbox performance.

The AppleScript editor saves script files with the. scpt extension by default. You can also save the file as a text file
(using either Mac or Unix line endings), but you must then change the file extension to .scpt manually before using the
script in Mbox.

Shell Scripts

For simple scripts (single commands) use the Terminal application to test the commands and syntax first, then copy
and paste the text into a text editor. For more complex scripts, the commands must be created in the text editor first
and then tested.

IMPORTANT! Shell scripts must be converted to be executable before being used in Mbox.

To save a script as a text file and make it an executable shell script, do the following:

Step

1. Save the script as a file using the file extension '.sh'

Step

2. Open a Terminal window and type "chmod 755 " (make sure to include the trailing space) and then drag and

drop the saved .sh file onto the Terminal window.

Step

3. Press [return] on the keyboard. (This step makes the file executable.)

Step

4. Double-click on the file to run the script for testing.

Shell scripts can be used to control many aspects on the computer, including external network communications. Shell
scripts do not require other applications to be launched on the computer and therefore may have less impact on the
performance of Mbox. However, shell scripts can be dangerous if they modify the core functionality of the computer
or its communications.

Advertising