Site logo

Template for batch processor

In essence, the script created from the template knows whether it’s executed from the batch processor or as a regular script.
In other words, if you want to make your script work both in the batch processor and as a regular script, use this template as a starting point.
The CalledFromBatchProcessor() function checks the current stack trace and if it contains ‘[Batch processor’, it returns true, otherwise – false.

Also, the template shows how to handle arguments: the parameters that can be optionally sent from the primary script (the batch processor) to the secondary script. See here more on the arguments.
If you execute the script from InDesign, arguments are unavailable. If from the batch processor, some parameters can be skipped or you may not send arguments at all. For that reason, you should set default parameters.

Click here to download the template.

Back to the main Batch processor page