Hello, I am using the following script to export my Indesign documents as single page PDFs, and naming in a specific way:
var pdfPreset = "<PDF_preset>";
var exportPath = "<filepath>";
var jobNumber = "XXXXXX_"
for (aPage=0; aPage < app.activeDocument.pages.length; aPage++)
{
app.pdfExportPreferences.pageRange = app.activeDocument.pages[aPage].name;
app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File(exportPath+"/"+jobNumber+pad(app.activeDocument.pages[aPage].name)+".pdf"), false, pdfPreset);
function pad (n) {
return ("00000"+n).slice(-3);
}
}
This will output the filenames as XXXXXX_002-003, etc, where XXXXXX is the customers ID number.
Instead of typing in each customers ID number in the script, I want to tag a text box within the document that contains only the customer's job number, then use the contents of that text box as the jobNumber variable.
How can I do that?
There are many ways of "tagging" information in an InDesign document. For what you're doing, I'd suggest a unique paragraph style used only for this purpose, then you can search for text in it and use the contents.
Dave