Example: Working with TruEdit Toolbox Scripts

The TruEdit Toolbox feature of the TruEdit InDesign/InCopy Plugin provides a set of automations that your own scripts can leverage.

For example, let’s say you have a script that checks out a TruEdit document, does something to it, then exports a PDF, then checks the document back in. In this case, your script can call the exportPDF Toolbox Script (which offers token-based file naming and uses a specified preference set) instead of having to create this functionality yourself. To do this, you need to set a prefSet value that tells the Toolbox script you are invoking which preference set you want the script to use when it executes.

By default, the Toolbox scripts will act on the app.activeDocument object.

Example 1: Calling ExportPDF Toolbox Script on the Active Document using a Mac Path

try {
    app.scriptArgs.set("prefSet", "nameOfPrefSet");
    app.doScript('/Applications/Adobe\ InDesign\ CC\ 2018/Plug-Ins/TruEditModel/toolbox/exportPDF.jsxbin', ScriptLanguage.JAVASCRIPT);    
} catch (ex) {
    alert ("Error: " + ex);
}

Example 2: Calling ExportPDF Toolbox Script on the Active Document using a Windows Path

try {
    app.scriptArgs.set("prefSet", "nameOfPrefSet");
    app.doScript('/c/Program Files/Adobe/Adobe\ InDesign\ CC\ 2018/Plug-Ins/TruEditModel/toolbox/exportPDF.jsxbin', ScriptLanguage.JAVASCRIPT);    
} catch (ex) {
    alert ("Error: " + ex);
}