Scripting Module

Custom Relinking of Fields

The “Adopt Fields” method of relinking assumes field names and key field values are consistent between the existing links and the new data.  It was designed to link fields from one data source to another, and as such is limited to changing the key element of a link. In some circumstances it may be necessary […]

Using LUA commands to create an index/glossary

  Consider a data source with the following data. This example creates a glossary of all the words in the ‘Glossary’ field, showing the pages they appear on. The words are sorted alphabetically and the pages are numerical within each word. The resulting output looks something like: big – p 13,14, bill – p 13, black […]

Accessing Guide Based Pagination Progress on InDesign Server

There is a script called “PaginationProgress.jsx” which you can place in the Data Sources “Scripts” folder. This is passed script arguments: “datasource”  : The Data Source Name “stepindex”  : Current Step Index “stepcount” :  Total Number of Steps “step message” : Related Message You can access them like this: var stepCount = Number(app.scriptArgs.getValue(“stepcount”));

Advanced Conditional Processing Using Lua

EasyCatalog supports an embedded version of the Lua programming language.  When text is processed, any commands between  delimiters [[ and ]] are processed using Lua. EasyCatalog supplements Lua with functions to make data access easier. For example:

In this example, if the contents of the ‘new’ field are equal to ‘1’ the text NEW! will be output. […]

Get the name of the selected data source

While you can get the selected panel (DSV) object. To get the name of the data source, the parent object needs to accessed:

Setting pagination options via a script

The options shown on the “Paginate” dialog can all be set using the ‘setPaginationOption‘ scripting method which is available on the datasource object.  This method takes two parameters: the name of the option to set and the value to set it to.

The value used for the ‘name‘ parameter can be determined by examining […]

Referencing a field in a CALLSCRIPT script

Here’s an example CALLSCRIPT script that references record data passed to it:

Using a post image import script to manipulate an image

After EasyCatalog imports an image, it looks for a script called “PostImageImport.jsx” in both the Data Source->Scripts folder and the EasyCatalog Workspace Folder->Scripts folder. This can be used to manipulate an image after import. The example below applies the DETECT EDGES clipping path setting: