Viz Trio User Guide

Version 3.2 | Published June 29, 2021 ©

Viz Trio Scripting

A VBScript can be attached to any show or template to enable custom functionality. Typical applications for scripting include importing data from database sources and giving users guidance. All template instances with a script will inherit the script. Viz Trio supports Macro Commands and Events that may be used as part of the script.

This section covers the following topics:

Script Directory

All show scripts are stored on the Media Sequencer. However, a local directory is still needed for script that are stored as files:

  • Open the Configuration window, and set the Script Path under the User Interface/Paths section.

The default script directory is %ProgramData%\Vizrt\Trio\scripts normally C:\ProgramData\Vizrt\Trio\scripts .

If a show is imported without its underlying scripted templates in the script folder, Viz Trio will create an empty script file. Since the script files are empty, you must reassign the scripts and restart Viz Trio to load the updated script memory.

Note: Versions of Trio prior to 3.0 store scripts in C:\Program Files (x86)\Vizrt\Viz Trio\scripts. Script files for a scripted show or template are copied to the Viz Trio script folder.

Script Editor

images/download/attachments/37573029/scripting_script_editor_buttons.png

  • Predefined Functions - Opens the Predefined Functions window containing Commands and Events that can be used in scripts.

  • Show Library Scripts - Opens the Library Scripts window displaying scripts which can be attached to a template as a ‘USEUNIT reference.

  • Syntax check - Checks syntax correctness.

  • Save script - Saves a script to the server. You can also save the script by right-clicking inside the script window and selecting Save to repository from the Context Menu, where you can also save units to file.

  • Manage show scripts - Opens the Script Manager for the show that's open.

  • Close all units - Closes all script units.

  • Change font - Changes font settings for the script editor.

  • Combo box - Jumps between script functions and procedures within the same script.

This section covers the following topics:

Context Menu

images/download/attachments/37573029/scripting_script_menu.png

  • New edit window: Opens a new edit window.

  • Insert from file: Inserts script from file.

  • Load from file: Loads script from file in a new tab window.

  • Undo: Undoes latest change.

  • Redo: Redoes latest undo.

  • Select All: Selects the whole script.

  • Cut: Cuts selected text.

  • Copy: Copies selected text.

  • Paste: Pastes clipboard content.

  • Save to repository: Saves the script.

  • Toggle Bookmarks: Toggles between inserting and removing a bookmark at the selected row.

  • Go to Bookmarks: Moves the cursor to the selected bookmark.

  • Find: Opens a search window. Search for text strings and expressions.

  • Replace: Opens a search and replace window. Search for a string to be replaced by another.

  • Use script unit: Opens a window with a list of accessible units. Select one to use with another script or script unit.

  • Print: Opens a print window.

  • Close unit: Closes the unit.

  • Manage show scripts - Opens a dialog where you can import, export, and delete a script from a template.

Shortcut Commands

  • CTRL + TAB: Switches between the open scripting tabs.

  • CTRL + SPACE - Displays the Code Insight Window containing a list of parameters, variables, functions, etc. available to the currently open script or in attached sub scripts.

  • CTRL + SHIFT + SPACE - Displays code completion hints.

  • CTRL + Left mouse button - Opens the highlighted function; works across scripts and scripts units, but not within the same script. For this to work, the USEUNIT <scriptname> notation must be added to the script in order to link the scripts together.

Predefined Functions

images/download/attachments/37573029/scripting_script_predefined_functions_button.png
Almost all script functions in Viz Trio are macro Commands that can be wrapped in the TrioCmd("macro_command") format. The predefined functions window also contains a set of Events that can be added to scripts.

Note: TrioCmd() supports UTF16. If you need UTF8 support, you can use TrioCmdUTF8().

Library Scripts

images/download/attachments/37573029/scripting_show_library_scripts_button.png
Script units can be added to an assigned template script, letting you write generic and specialized script units that are useful for more than one template. When using script files, a local or shared script path must be configured under the Graphic Hub settings.

Script Manager

images/download/attachments/37573029/scripting_scripts_for_show_dialog.png
The Manage Show Scripts button opens a window where you can import, export, and delete VBScript files from the current show.

Assigning a Script to a Show

  1. Open the Show Properties.

  2. Click the browse button next to the Show Script field.

  3. From the Choose Show Script window select either a file script (local or shared) or a Media Sequencer script.

  4. Click OK.

Assigning a Script to a Template

  1. Right-click a template and select Script > Assign script > New.

  2. Optional: Assign an existing script from the File or Show options.

  3. Enter a name for the script, and store the script on the Media Sequencer or to a local or shared script path (see Graphic Hub).

  4. Click OK.

Adding a Predefined Function

  1. Open a template with an assigned script.

  2. Click Edit script (see Controls).

  3. Click Predefined functions in the Script Directory.

  4. Select a function, and click Add.

Adding a Library Script Unit

  1. Open a template with an assigned script.

  2. Click Edit script (see Controls).

  3. Click Library scripts in the Script Directory.

  4. Select a script unit to use, and click OK.

Editing a Show Script

  • Right click the Template list pane and select Script and Edit Show Script from the menu.

Editing a Script

Open a template with an assigned script, and click Edit Script (see Controls).

Executing a Script

images/download/attachments/37573029/scripting_execute_script_button.png

Open a template with an assigned script, and click Execute Script (see Controls).

Script Backup

It's recommended to save scripts created for a specific show together with the show on Media Sequencer. A backup of the Media Sequencer files is therefore necessary.

Script Errors

If the script contains an error, the script window will automatically open and highlight the script error location. The script error is also reported in the Error Messages Window.