Creating Scripts
T-HSCP-001-002
You can create scripts for Harmony by using the Script Editor view.
TB_sceneCreated
script. This script is automatically executed when you create a scene. By default, it sets the scene's length to 60 frames and creates a basic layout containing a single drawing layer. You can customize this script to automatically set up scenes you create to fit your project's needs.
- Windows: C:\Users\[username]\AppData\Roaming\Toon Boom Animation\Toon Boom Harmony Essentials\1500-scripts
- macOS: /Users/[username]/Library/Preferences/Toon Boom Animation/Toon Boom Harmony Essentials/1500-scripts
-
In the top-right corner of the Camera or Drawing view, click on the Add View button and select Script Editor.
The Script Editor view is added to your workspace. It lists all the scripts packaged with Harmony as well as any script you previously created.
-
Do one o the following:
- In the Script Editor toolbar, click the New Script button.
- From the top-left corner of the Script Editor, click on the Menu button, and select File > New Script.
The New Script dialog box appears.
-
Type in a name for your script and click on OK.
A dialog prompts you to select the location in which to create the script.
-
In the drop-down menu, select the location in which you want to create the script:
-
User: Saves the script to your user preferences. You will be able to run and edit the script from any scene as long as you are logged in as the same user.
- Scene: Save the script to the scene's scripts sub-folder. Anyone will be able to edit and run the script when working on this specific scene.
Your script is added to the list of scripts in the Script Editor.
-
-
Select the script your just created in the list.
You can now start editing your script in the script editor.
-
Click on the text field in the right area of the Script Editor and start writing your script.
The following is an example of a script that will display a message box saying "Hello World!"
function HelloWorld()
{
MessageBox.information("Hello World!");
}