Anyone have a script to export pdf and png at same time?
I have a lot of documents to export to png and pdf (384 documents, basically the same documents, 12 shells and 32 different sales people names). I found the script below but it's not working in Indesign 20.2, and I'm too dumb to edit it. I thought the pdf preset name was the issue, but none seem to work.
In a perfect world, this script would work on all open documents (I generally open 32 at a time), but I think that's pushing it. Any help is appreciated.
var doc = app.activeDocument;
// PDF Export
function exportPDF() {
var pdfExportPath = doc.filePath.parent + "/" + doc.name.split(".")[0] + ".pdf";
doc.exportDocument({
file: new File(pdfExportPath),
exportPDFOptions: {
presetName:"
[PDF/X-4:2008]",
},
});
}
// PNG Export
function exportPNG() {
var pngExportPath = doc.filePath.parent + "/" + doc.name.split(".")[0] + ".png";
doc.exportDocument({
file: new File(pngExportPath),
exportJPEGOptions: {
fileFormat:ExportFileFormat.PNG,
},
});
}
// Call the functions
exportPDF();
exportPNG();


