Scripting Module

Using the ‘monitorFolder’ method

The Scripting Module now provides a mechanism to automatically execute an ExtendScript file when a specific ‘trigger’ file is dropped into a monitored folder. Starting monitoring The ‘monitorFolder’ method should be called on the EasyCatalog object to begin polling a specific folder – e.g.

Four folders are required for the monitoring process: An ‘in‘ […]

Scripting Support For Links

ecLink Class From 2022, an ecLink class has been added to the scripting module to enhance the scriptability in the creation, inspection and modification of links. This represents an EasyCatalog link, either text or frame based. An ecLinks collection exists on most InDesign layout objects. Basic Properties A link is described using 3 basic properties: […]

Replacing Delimited Field Names With Field Content

The example below replaces field names delimited between { and } with the field content. E.g: “This is a field with another field {name} inside” The replaces “name” with the contents of field called “name”.

 

Custom Menus and Dialogs

Overview Lua scripts can be integrated with EasyCatalog to provide custom menus and dialog boxes. User Interface is provided by the the InDesign Scripting DOM, which offers dialog creation and control. Details on how to access this from Lua are here. Creating a Custom Menu Option Adding a custom menu option is a case of […]

Accessing the InDesign Scripting DOM via Lua

Overview The InDesign Scripting DOM provides full access to the creation and manipulation of all content within InDesign. By combining this the speed of Lua with the data access and control facilities of EasyCatalog, it’s possible to create data driven content in virtually any format. Accessing The InDesign Scripting DOM can be accessed via Lua […]

Creating a Calendar using LUA

This example code creates a calendar tabular field using data where each record is an event on a calendar. The data has fields contain the month and year. ย GROUPSCRIPT is used to call the script for each month group. This data can then be paginated using Master based pagination.

 

Custom Image Import

For images that are sourced externally but are not URL or File based, the “Custom” option can be chosen in the picture location section of the field options. When this is set, EasyCatalog looks for a file called ‘CustomImageImport.jsx’ in the ‘Scripts’ folder of a data source. Here’s a simple example that displays the field […]

Custom Relinking of Fields

The standard “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 […]

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: