Skip to main content
Participant
September 21, 2023
Question

How to create a Batch Script for InDesign files?

  • September 21, 2023
  • 2 replies
  • 1599 views

Apologies if this is a question that has been answered (or is regularly asked)
Wanting to record a set of instructions in an Indesign file like you can do in Photoshop where you could run that as a batch against a folder full of files.

Eg of Instructions would be:
1. Open File

2. Find text eg. 27 July 2023

3. Change text to. eg 12 October 2023

4. Save file

5. Export file as a PDF to a different folder

This topic has been closed for replies.

2 replies

Robert at ID-Tasker
Legend
September 22, 2023

If you work on a PC - my ID-Tasker is EXACTLY for this.

Even the free version can do this - and WAY more. 

 

Participant
September 22, 2023

Thanks Robert, the person I'm trying to help with this works on a PC so much appreciated.

What would someone on a MAC have to use? Just curious.

Robert at ID-Tasker
Legend
September 22, 2023

There are some tools for batch processing - but they are rather limited to a single / specific operation... 

 

With ID-Tasker - you can do whatever you want - and process in the same way - or conditionally - whole servers of files... 

 

Community Expert
September 21, 2023

Hi Tim,

InDesign does not have any feature to record an operation. You could use the following code, make the appropriate changes like the path of the INDD and PDF file and also the string to search and the string to use as the replacement.

var doc = app.open("/Users/manan/Downloads/sample.indd")
app.findTextPreferences = app.changeTextPreferences = null
app.findTextPreferences.findWhat = "27 July 2023"
app.changeTextPreferences.changeTo = "12 October 2023"
doc.changeText()
app.findTextPreferences = app.changeTextPreferences = null
doc.exportFile(ExportFormat.PDF_TYPE, "/Users/manan/Downloads/sample.pdf", false)
doc.close(SaveOptions.YES)

 -Manan

-Manan
Participant
September 21, 2023

Thank you Manan, and where do I run the script from? Is it somewhere within InDesign or in an external program? New to this type of thing.

Community Expert
September 22, 2023

Check out the following article to know about how to run the script

https://creativepro.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post/

Also, JS would run both on the MAC as well as WIN so you are good to go

-Manan

-Manan