Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Find multi layer names and alert

$
0
0

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


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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