Using ExtendScripts

You can develop your own ExtendScripts, register them to specific Templater Events, and have them execute when those events are broadcast by Templater. Within the ExtendScript file you register with Templater, we support methods that allow your code to access and manipulate Templater’s internal memory. This grants you access to things like the batch of jobs, specific job data, or layer data from within your code. See the Templater ExtendScript API for more information.

Sample ExtendScripts are available at Dataclay's code repository on GitHub.

ClosedRegistering ExtendScripts within the Preferences dialog

  1. In the Templater preferences dialog, in the Bot Settings group, click Setup ExtendScripts.
  2. In the Register ExtendScript with Events window that opens, select a Templater event group to show available events associated with the group.
  3. register ExtendScripts
  4. Select either a Before event or After event. To enable an script to execute when a specific event is broadcast, you must select the event checkbox. If the checkbox is deselected, the script is disabled.
  5. Click Choose Script... and select an ExtendScript file that you want to run for that particular event. Alternatively, enter an absolute path to the script into the event field.
  6. To add additional shell scripts for other Templater events, repeat steps 2 through 4.
  7. When you are finished adding script information, click OK.
    The scripts are registered to Bot events.

ClosedRegistering ExtendScripts within the CLI options file

In the templater-options.json file, in the bot object, set the specific event property to the absolute path of the ExtendScript file you want to run for that particular event. Refer to the following table for events that you can register an ExtendScript to in the bot object. For detailed descriptions of each event, see Templater Events.

Event in bot object Description Broadcast...
"pre_jsx_data" Before data ...before Templater retrieves data
"post_jsx_data" After data ...after Templater retrieves data
"pre_jsx_batch" Before batch ...before Templater's main iteration loop
"post_jsx_batch" After batch ...after Templater's main iteration loop
"pre_jsx_job" Before job ...before processing a single job
"post_jsx_job" After job ...after processing a single job
"pre_jsx_udpate" Before update ...before updating any layers
"post_jsx_update" After update ...after updating any layers
"pre_jsx_output" Before output ...before rendering any output
"post_jsx_output" After output ...after rendering any output
"enable_jsx" Bot enabled ...when Bot is enabled
"shutdown_jsx" Bot disabled ...when Bot is disabled