Script Editor View

The Scripting view allows you to edit scripts to run in Harmony directly from the application. It displays a list of available scripts, from which you can select an existing script, edit it, test it and save it. The Script Editor will highlight the syntax of your script for easy reading.

NOTE To learn more about scripting in Harmony, see About Scripting.

Script Editor View

Parameter Description
Script Editor menu The menu for this view—see Script Editor View Menu.
Script Editor toolbar The toolbar for this view—see Script Editor Toolbar.

Script list

The list of script files available as well as their location and their read and write permissions. Selecting a script in this list will open it in the editor.

NOTE The << Sandbox >> item at the top of the list does not correspond to an actual script file. It is a temporary container to type and test code, and its content cannot be saved.

The file list has three columns: File, Location and Permissions.

  • The File column indicates the filename of each script.

    NOTE The << Sandbox >> item at the top of the list does not correspond to an actual script file. It is a temporary container to type and test code, and its content cannot be saved.
  • The Location of the script can be one of the following:

    • Application Folder: Scripts that are packaged and installed with Harmony. By default, you cannot edit these scripts until you select them and click on Make Editable, at which point you are prompted to copy the script to a location from which you can edit them.

      Scripts in the Application Resources folder are in the following location:

      • Windows: C:\Program Files (x86)\Toon Boom Animation\Toon Boom Harmony 20 Advanced\resources\scripts
      • macOS: /Applications/Toon Boom Harmony 20 Advanced/Harmony Advanced.app/Contents/tba/resources/scripts
      • GNU/Linux:/usr/local/ToonBoomAnimation/harmonyAdvanced_20/resources/scripts
    • User: Scripts that are saved in your user preferences. Those scripts can be edited and executed from any scene, provided that you are logged in as the same user.

      In Harmony Stand Alone, scripts in the User folder are in the following location:

      • Windows: C:\Users\[username]\AppData\Roaming\Toon Boom Animation\Toon Boom Harmony Advanced\2000-scripts
      • macOS: /Users/[username]/Library/Preferences/Toon Boom Animation/Toon Boom Harmony Advanced/2000-scripts
      • GNU/Linux:/home/[username]/Toon Boom Animation/Toon Boom Harmony Advanced/2000-scripts

      In Harmony Server, scripts in the User folder are in the following location:

      /USA_DB/users/[username]/HarmonyAdvanced/2000-scripts

    • Scene: Scripts in the scripts sub-folder of the currently open scene. These scripts can only be edited and executed when the current scene is open.

    • Job (Harmony Server only): When using Harmony Server, these are the scripts saved in the directory of the current scene's jon. These scripts can be edited and executed by any user when any scene that is part of this job is open.

      Scripts in the Job folder can be found in the following location:

      /USA_DB/jobs/[job name]

    • Environment (Harmony Server only): When using Harmony Server, these are scripts saved in the directory of the current scene's environment. These scripts can be edited and executed by any user when any scene that is part of this environment is open.

      Scripts in the Environment folder can be found in the following location:

      /USA_DB/environments/[environment name]

    • Global (Harmony Server only): Scripts in the Harmony database's scripts directory. These scripts can be edited by any user when any scene in the database is open.

      Scripts in the Global folder can be found in the following location:

      /USA_DB/scripts

    • System Variable: Scripts inside the directory set in the TOONBOOM_GLOBAL_SCRIPT_LOCATION environment variable, if this variable is set. These scripts can be edited and executed by anyone on your workstation.
    NOTE

    When two or more scripts with the same file name exist in different locations, Harmony will give priority to a single one of these scripts. The script given priority will be the one listed in the Script Editor and the one executed if it is associated to a toolbar button.

    Which script is prioritized is determined by the order of priority of script locations. From highest priority to lowest priority, the order goes as follows:

    User > Scene > System Variable > Job > Environment > Global > Application Resources

    An exception to this rule is if you have a script with the same name in both the scene folder and your user preferences. In this case, both versions of the script will be listed and you will be able to edit both.

  • The Permissions of the script can be one of the following:

    • Read Only: You cannot edit the script in the Script Editor and save your changes.

      NOTES
      • If the script's location is the Application Resources folder, it will always be Read Only to prevent you from making changes to scripts packaged with Harmony. However, you can click on the Make Editable button below the script editor to make a copy of the script in your user preferences folder, after which you can make changes to this copy.
      • If the script is in any other location and is Read Only, then it is likely that a network administrator made the script or the folder containing the script read-only to prevent other users from making unwanted changes to it.
    • Read/Write: You can edit the script in the Script Editor and save your changes.

Editor

A text field in which you can edit the selected script.

NOTE If the selected script is in the Application Resources folder, you will not be able to edit it until you click on the Make Editable button.

Search toolbar

Allows you to type in a keyword and search for this keyword within the script. You can use the Next button to go to the next instance of the keyword and the Previous button to go to the previous instance.

Cancel If you have made any changes to your script that you have not yet saved, this discards those changes and reloads the saved version.
Restore to Default

If the selected script is a script that was packaged with Harmony, and which you copied to your User folder, to the Scene folder or to the Job, Environment or Global folder to make changes to it, you can click on this button to delete this copy of this script and resume using the original version of the script that is packaged with Harmony instead.

IMPORTANT This will permanently delete your version of the script and any changes you have made to it.

Verify

Verifies that the script has no syntax error.

Make Editable

If the currently selected script is in the Application Resources folder, you cannot edit it. By clicking on this button, the script can be copied to a location where you can edit it.

When you click on this button, you are prompted to choose whether to copy in either of these locations:

  • User: Saves the script to a directory in your user preferences directory. You will be able to run and edit the script from any scene as long as you are logged in as the same user.

    NOTE If you are using Harmony Stand Alone, the script will be saved to the preferences for your account on your computer. if you are using Harmony Server, the script will be saved to the preferences for your Harmony database user.
  • Global: If you are using Harmony Server, select this option to save 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: If you are using Harmony Server, select this option to save 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: If you are using Harmony Server, select this option to save 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: 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.
  • System Variable: Save the script to the directory in the TOONBOOM_GLOBAL_SCRIPT_LOCATION environment variable. This option is only available if this environment variable is set.
NOTE

This button will be greyed out if the script is in any location other than Application Resources and is read only.

Save

Saves the modifications you made to the script.

This button replaces the Make Editable button after you have used the Make Editable button to copy the script to a location from which you can edit it.