The Control Center scripting interface allows you to script and automate manipulations to the database.
You can run a Control Center script immediately from a server or client machine, or launch Control Center as a script server from the server machine, and allow clients to send scripts to it through Telnet.
You can run a script in Control Center by writing the script in a text file, then running Control Center with the following syntax:
Controlcenter will execute the script in batch mode and exit.
The following is a sample script that imports an exported scene package three times, renaming it each time:
ControlCenter can be ran as a server from the database server machine and used remotely via the Telnet protocol. Doing this instead of running scripts from a client machine can significantly increase the performance of scripts, as ControlCenter will have direct access to the database files.
To act as a script server, ControlCenter must be run in a shell with the -script parameter. ControlCenter will launch as a server and will executed commands it receives through the port specified in the environment variable TOONBOOM_REMOTE_SCRIPT, which must be set beforehand.
The port number can also be specified with the -tcpPort argument:
In order to send scripts containing multiple lines to the script server, scripts must have a beginning and end token. These tokens are named TB_BeginScript and TB_EndScript, respectively. Control Center will execute each line of script betweens these tokens.
The following is a simple sample script to print out all versions of all scenes in a environment named "Test" and a job named "a".
As these are database operations protected by locks, it is important to check the message logs. The ControlCentre object provides two very important methods to do this. Most scripts should have the following two lines at the end.
All messages that would normally appear in the applications message log can now be viewed in the telnet session.