Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 142955

batch pdf export script problem

$
0
0

Hello guys,

 

I got problem with my code cause it doesn't work at all,

 

Could someone help me to correct it

it's something with the exportfile line13

 


//==== Batch PDF =====\\
/* InDesign JavaScript to Create PDFs of a batch of InDesign files using an export PDF preset */
var myPDFExportPreset = app.pdfExportPresets.item("Smallest file size"); // Change myPDFpreset to the name of the preset you want to use
var myFileLocation = Folder.selectDialog("Please select path to files");
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]));
app.activeDocument.exportFile(  ExportFormat.pdfType,  File(myFolder.fsName + "/" + app.activeDocument.name.split(".indd")[0] + ".pdf"),  false,  myPDFExportPreset  );
app.activeDocument.close(SaveOptions.no);
}

Viewing all articles
Browse latest Browse all 142955

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>