Scripting Interface |
The scripting interface in Harmony uses Qt Script to provide an efficient way to program tools and macros that can, among other things, be used to manipulate scenes and automate tasks.
Scripts can be launched from a button in the Scripting toolbar, from the Script Editor, the Script Node, the Master Controller Node as well as from a command line terminal.
Qt Script is based on the ECMAScript 3.0 standard. EMCAScript can be considered an extension of JavaScript. JavaScript documentation is widely available on the internet. The first 11 chapters (Part 1) of the book Eloquent JavaScript by Marijn Haverbeke which can be read online for free at http://eloquentjavascript.net/ are a great introduction to the subject.
Start by opening the Script Editor view. Then, select Sandbox from the scripts list. The sandbox is provided as a means to test out scripts without having to create or modify a script file. For example, try typing the following script:
Then, click on the Run button in the Script Editor toolbar, or open the Script Editor menu from the top-left corner and select Play/Debug > Run.
You can run a script on a Harmony scene from the terminal, without opening Harmony. This is referred to as running a script in batch mode. You can run a script in Harmony from a command line by using the following syntax: