Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Layer Comps To Files with no number count in the middle

$
0
0

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


Viewing all articles
Browse latest Browse all 12244

Trending Articles



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