Export all conditional text iterations to a pdf
I have a document with over 70 pages of images that need 20 different text combinations for each page. I have my conditional text all set up and was looking for a way to easily export all the different combinations to a .pdf.
I found this post which is exactly what I want to do. Here is the script from the post:
var nameOfThePDFExportPresetYouWantToUse = '[High Quality Print]' //please don't forget to set!
var currDoc = app.activeDocument;
var currFilePath = currDoc.filePath.absoluteURI + '/';
var currFileName = currDoc.name.replace(/.indd/, '');
var currConditions = currDoc.conditions;
//set all conditions visible to false
currConditions.everyItem().visible = false;
l = currConditions.length;
//cycle thru conditions
while(l--){
currCondition = currConditions;
//set actual condition visible to true
currCondition.visible = true;
currConditionName = currCondition.name
//set pdfName
var exportTo = File(currFilePath + currFileName + '_' + currConditionName +'.pdf');
//Have a look here:
//export PDF. to choose backgroundexport. use the second line of code
currDoc.exportFile(ExportFormat.PDF_TYPE, exportTo,false, nameOfThePDFExportPresetYouWantToUse);
//currDoc.asynchronousExportFile(ExportFormat.PDF_TYPE, exportTo,false, nameOfThePDFExportPresetYouWantToUse);
//set actual condition visible to false
currCondition.visible = false;
}
I copied the script from this post, but am getting the following error when I try to run it:
Error Number: 55
Error String: Object does not support the property or method 'visible'
I am a complete novice when it comes to scripting, so I am unable to trouble shoot it at all. The error line is in orange. Any help would be appreciated!
