I want to find a script (preferably Javascript) and all it needs to do is export a PDF to a specific folder that I can set the path for in the script.

Does anyone know of a script that might have most of that functionality that I can then take and just edit it so that it has the PDF settings I want and I can input the file path I need?

3 Answers 3


There is a scripting reference for InDesign that gives you examples of how to do this. If you look through the table of contents you can see that there is a section that shows you how to export as PDF.

Here is the link: https://www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/scripting/InDesign_ScriptingGuide_JS.pdf

That being said, here is the example that Adobe gives for exporting to PDF. Use the scripting reference to do any additional actions that you need.

var myPDFExportPreset = app.pdfExportPresets.item("_ENTER A PRESET NAME_");
app.activeDocument.exportFile(ExportFormat.pdfType, File("_ENTER A PATH_"), false, myPDFExportPreset);

There is a program that is no longer being updated, called Action Recorder by Rorohiko that lets you record actions in InDesign. You can still download it on an as is basis, the demo version is limited to per use, and I believe you have to pay for it. Here is the link. It does not work for CC versions, and as the website says, it may or may not work with CS6. Perhaps you can give that a try if you have a CS version. Let us know if it works!

//==== Batch PDF =====\\ 

/* InDesign JavaScript to Create PDFs of a batch of InDesign files using an export PDF preset */ 

var myPDFExportPreset = app.pdfExportPresets.item("[High Quality Print]"); // Change myPDFpreset to the name of the preset you want to use 

var myFileLocation = Folder.selectDialog("Please select path to files"); // file path selection

myFolder = new Folder ([myFileLocation]); 

myFolderContents = myFolder.getFiles("*.indd"); // array 

myFileAmount = (myFolderContents.length - 1); 

// ===== Open, Export as PDF, and Close files ===== \\  

for (i = myFileAmount; i >= 0; i--) 


app.open(File (myFolderContents[i])); 



  new File(myFolder.fsName + "/" + app.activeDocument.name.split(".indd")[0] + ".pdf"), 






alert("PDF Created")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.