This article outlines how to import scripts written in Javascript. If you want to work with Python, please see Python Script Console View and Toon Boom Harmony -- Python Interface.
Script guidelines
Before importing an external script, take note of the following:
- The scripts intended for import must be in javascript (.js) format.
- The external scripts cannot be contained in a zipped or compressed folder.
- Custom icons can be created for external scripts to make them easier to recognize in Harmony’s Scripting toolbar.
- A user interface (.ui) file, or icon (.png) file, will also automatically be imported when:
- They are in the same folder as the script
- They have the same filename as the script
- You can set custom folders for saving scripts, see Storing in a Custom Folder.
- Read more about scripting in Harmony, see About Scripting.
Step 1: Importing a script
- Open the Script Editor window by doing either of the following:
- In the top-menu, select Windows > Script Editor.
- In any view window, select the Add View
button and choose Script Editor.
- The Script Editor view opens:
- To locate a script to import, do one of the following:
- In the Script Editor toolbar, select the Import Script
button.
- In the top-left corner of the Script Editor view, click on the Menu
button and select File > Import Script.
- In the Script Editor toolbar, select the Import Script
- A browser window will appear.
- Search the computer directory to locate the script and select the Open button to import it.
- The Save Script dialog box will appear:
- From the dropdown menu, choose one of the following options based on your version of Harmony:
Harmony Standalone Options:
- User: The script is saved to a folder in your user preferences directory. You will be able to run and edit the script in any scene as long as you are logged in as the same user.
- Scene: Saves 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.
Harmony Server Options:
- User: The script is saved to a folder in your user preferences directory. You will be able to run and edit the script in any scene as long as you are logged in as the same user.
- Global: Saves the script to the Harmony database's global script directory. Anyone who is logged in to the database will be able to edit and run this script.
- Environment: Saves the script to the current scene's environment. Anyone will be able to edit and run the script as long as they are working on a scene inside this environment.
- Job: Saves the script to the current scene's job. Anyone will be able to edit and run the script as long as they are working on a scene inside this job.
- Scene: Saves 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.
- System Variable: Saves the script to the directory in the TOONBOOM_GLOBAL_SCRIPT_LOCATION environment variable. This option is only available if this environment variable is set.
- Repeat instructions 2 to 8 as many times as needed to import all your scripts.
TIP: Imported scripts can be added to the Scripting Toolbar. See How do I load and manage scripts? for more information. |