Hi Folks
Newby poster here hoping you can help.
I have a file with 181 layers and need to export 180 individual layers with 1 other layer switched on (so 2 layers on in each export). Any ideas how to do this with an action or script?
Thanks
si
Hi Simon
You can use Layer comps to do this, but the down side is that you have to toggle the layer visibility for every layer combination.
Open up the Layer comps panel in Window> Layer Comps
Turn on the visibility for the two layers that you need to save out for that single export. Then click New Layer Comp in the layer comps panel. Do so for all the combinations. When you have all the comps, go to File>Scripts>Layer comps to files. Then photoshop will save out all the comps for you.
Use keyboard shortcuts to increase your speed.
For more info:
http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e 41001031ab64-7870a.html
Several of the regulars from
http://forums.adobe.com/community/photoshop/photoshop_scripting
also drop by here, but for assistance with a Scripting approach to the issue you might want to ask over there, too.
But please be more specific – which export exactly (format etc.) and how are the layers structured (a screenshot of the Layers Panel might help).
Thanks for your reply Sharon but ithat is not what i need.
I would have to create 180 layer comps just so i can use the export layers to files script so it would take the same time to save out each combination of 2 layers.
Unfortunalely i can't put up a sgreen grab as i am under a tight nda.
I'll try to be more clear:
PSD consists of 181 layers only (no folders or treatments on any)
180 layers feature steps of a rotating car
1 layer is the background
The result i need to achieve is 180 jpgs on the common background.
So i'm looking for the quickest way to do this: Backround layer on, layer 1 on, save for web to jpg..... Switch off layer 1, switch on 2, save for web.... an continue to 180.
Thanks
Could you give this a try?
// combine top level layers with last one and save jpgs;
// be advised: this overwrites existing jpgs of the same name without prompting.
// 2012, use it at your own risk;
#target photoshop;
if (app.documents.length > 0) {
var thedoc = app.activeDocument;
// getting the name and location;
var docName = thedoc.name;
if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
else {var basename = docName};
// getting the location, if unsaved save to desktop;
try {var docPath = thedoc.path}
catch (e) {var docPath = "~/Desktop"};
// jpg options;
var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality = 9;
jpegOptions.embedColorProfile = true;
jpegOptions.matte = MatteType.NONE;
// hide all but last layer;
thedoc.layers[thedoc.layers.length - 1].visible = true;
for (var m = 0; m < thedoc.layers.length - 1; m++) {thedoc.layers[m].visible = false};
//
for (var n = 0; n < thedoc.layers.length - 1; n++) {
var theLayer = thedoc.layers[n];
theLayer.visible = true;
//save jpg as a copy:
thedoc.saveAs((new File(docPath+"/"+basename+"_"+n+".jpg")),jpegOptions,true);
theLayer.visible = false;
};
//that’s it; thanks to xbytor;
};
Thanks guys
Paul Riggott has sorted me out with this:
http://www.scriptsrus.talktalk.net/Layer%20Saver.htm
Perfect
North America
Europe, Middle East and Africa
Asia Pacific