Hi All,
I am trying to do export pdf using condition layer names, if this layer names mismatched should alert, else export pdf.
If only one layer it is working fine, when multi layers not working.
my code is always alert if the layer names are correct, what is wrong in my code, can any one correct.
help would be appreciate
ly = app.activeDocument.layers.everyItem().getElements();
for (i=0; i<ly.length; i++) {
if (ly[i].name != "BaseArtwork", "MagentaVariables", "PreprintedText", "OtherVariables") {
alert ("Check Layer names"), exit();
}else {
var myJobOptionName = "[Press Quality]";
var myOutFolderPathName = "/Users/wleastudio/Desktop/Watched Folder/Out/";
var myPDFFilePath;
var InDJobOption = app.pdfExportPresets;
myPDFFilePath = myOutFolderPathName+"/"+app.documents[0].name.split(".indd")[0].split(".INDD")[0]+".pdf";
app.documents[0].exportFile (ExportFormat.pdfType, myPDFFilePath, false, myJobOptionName);
}
}
Thanks in advance
steve