6 Replies Latest reply on Nov 25, 2014 9:26 AM by Chuck Uebele

    Layer Comps To Files with no number count in the middle

    latendresse76

      I have tried to find it and // it out with no success. I would like to have it when I "Layer Comps To Files" the it won't put the _0000_,_0001_, Etc.. in the middle of every file the comps are named acording ly so that when i do "Layer Comps To Files" i can add a bit to the front and the remainder of the comp name is enough i don't need count in the middle of the file.

       

      I had asked in a different post how to "Load Files to Stack..." could i instead have the "Layer Comps To Files" disreguard .png or .jpg in the end of the layer comp?

       

      SO in looking in to the script my self i know it has to be in this bit

       

                  for ( compsIndex = 0; compsIndex < compsCount; compsIndex++ ) {                 var compRef = docRef.layerComps[ compsIndex ];                 if (exportInfo.selectionOnly && !compRef.selected) continue; // selected only                 compRef.apply();                 var duppedDocument = app.activeDocument.duplicate();                 var fileNameBody = exportInfo.fileNamePrefix;                 fileNameBody += "_" + zeroSuppress(compsIndex, 4);                 fileNameBody += "_" + compRef.name;                 if (null != compRef.comment)    fileNameBody += "_" + compRef.comment;                 fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|\\\r\\\n]/g, "_");  // '/\:*?"<>|\r\n' -> '_'                 if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);                 saveFile(duppedDocument, fileNameBody, exportInfo);                 duppedDocument.close(SaveOptions.DONOTSAVECHANGES);             }

       

       

       

      this little bit

       

      var fileNameBody = exportInfo.fileNamePrefix;

      fileNameBody += "_" + zeroSuppress(compsIndex, 4);

      fileNameBody += "_" + compRef.name;

       

      stood out but i'm no scripter so help