Photoshop Scripting Plugin Saved my Day
http://www.adobe.com/support/downloads/detail.jsp?ftpID=1536
very recomandable
here is an example exporting Layers into Gifs:
(like you would need it, if you capture a lot of screenshots into layers)
very recomandable
here is an example exporting Layers into Gifs:
(like you would need it, if you capture a lot of screenshots into layers)
// loop through the document and set each layer's visibility to false
for(var i=0; i<activeDocument.layers.length; i++) {
// if it's a layer set, loop through it too
if(activeDocument.layers[i].layers) {
for(var j=0; j<activeDocument.layers[i].artLayers.length; j++) {
activeDocument.layers[i].artLayers[j].visible = 0;
}
}
// otherwise just set its visibility
else {
activeDocument.layers[i].visible = 0;
}
}
// loop through the document and set each layer's visibility to visible
// save it as a gif
// set its visibility back to false
for(var i=0; i<activeDocument.layers.length; i++) {
activeDocument.layers[i].visible = 1;
// it's not a layer set
if(!activeDocument.layers[i].layers) {
// set its name to layer name in a directory called "temp"
// in the same location as the script
gifFile = new File( "temp/"+activeDocument.layers[i].name+".gif" );
gifSaveOptions = new GIFSaveOptions();
gifSaveOptions.colors = 256;
gifSaveOptions.dither = Dither.NONE;
gifSaveOptions.matte = MatteType.NONE;
gifSaveOptions.preserveExactColors = 0;
gifSaveOptions.transparency = 1;
activeDocument.saveAs(gifFile, gifSaveOptions, true, Extension.LOWERCASE);
activeDocument.layers[i].visible = 0;
}
// it is a layer set
else {
// loop through the set
for(var j=0; j<activeDocument.layers[i].artLayers.length; j++) {
activeDocument.layers[i].artLayers[j].visible = 1;
// set its name to layer name in a directory called "temp"
// in the same location as the script
gifFile = new File( "temp/"+activeDocument.layers[i].artLayers[j].name+".gif" );
gifSaveOptions = new GIFSaveOptions();
gifSaveOptions.colors = 256;
gifSaveOptions.dither = Dither.NONE;
gifSaveOptions.matte = MatteType.NONE;
gifSaveOptions.preserveExactColors = 0;
gifSaveOptions.transparency = 1;
activeDocument.saveAs(gifFile, gifSaveOptions, true, Extension.LOWERCASE);
activeDocument.layers[i].artLayers[j].visible = 0;
}
activeDocument.layers[i].visible = 0;
}
}
[via lucanboots@]matthias - 28. Oct, 18:15
0 comments - add comment - 0 trackbacks








