FORUMS: list search recent posts

Scripting Newbie Seeks Help

COW Forums : Adobe Photoshop

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Rothenberg
Scripting Newbie Seeks Help
on Oct 8, 2008 at 6:09:25 pm

I'm not looking to become a scripting master but I do have a specific task I'd like to achieve - I wonder if anyone can give me some script nuggets so that I don't have to figure it out from scratch?

I have multilayered PSD files that I'd like to export as JPEGS in a progressive manner. In other words, filename.0 would be Layer 0 only; then filename.1 would be Layer 0 + Layer 1; and so on up to the top of the file.

Thanks in advance for any advice or assistance!




Michael Rothenberg
Peak Productions


Return to posts index

ekim wahs
Re: Scripting Newbie Seeks Help
on Oct 8, 2008 at 8:58:43 pm

In file/scripts there is already a script for saving layers to files. See if that works for you.

Mike Shaw
Photoshop QE


Return to posts index

Michael Rothenberg
Re: Scripting Newbie Seeks Help
on Oct 8, 2008 at 9:54:12 pm

Thanks. Of course that was the first thing I looked at, but I am looking to do something different and I don't know how to modify the script.

I want the file exports to ADD each layer to the prior export - in other words, the last export would be a JPEG of the whole file.

Any thoughts?



Michael Rothenberg
Peak Productions


Return to posts index


ekim wahs
Re: Scripting Newbie Seeks Help
on Oct 9, 2008 at 7:49:25 pm

Use this to create a new script. It will dupe the doc, then create layer comps setting the visibility for layers from the bottom up. You can then use Layer Comps to files script to save files of the layer comps.

var docRef = app.activeDocument;
var layerCount = docRef.layers.length


var duppedDocument = app.activeDocument.duplicate();
duppedDocument.activeLayer = duppedDocument.layers[duppedDocument.layers.length-1]; // for removing
setInvisibleAllArtLayers(duppedDocument);
setVisibleLayersComps(duppedDocument);


function setInvisibleAllArtLayers(obj) {
for( var i = 0; i < obj.artLayers.length; i++) {
//obj.artLayers[i].allLocked = false;
obj.artLayers[i].visible = false;
}
}


function setVisibleLayersComps(obj) {
var layerCount = obj.artLayers.length -1

for( var i = 0; i < obj.artLayers.length; i++) {
//obj.artLayers[i].allLocked = false;
obj.artLayers[layerCount].visible = true;
compName = obj.artLayers[layerCount].name

obj.layerComps.add(compName, '', true, true, true);
layerCount = layerCount-1
//compName = artLayers[i].name

}
}

Mike Shaw
Photoshop QE


Return to posts index

Michael Rothenberg
Re: Scripting Newbie Seeks Help - THANK YOU!!!
on Oct 10, 2008 at 2:24:45 pm

Mike,

Thank you SO much. It never fails to amaze me how much ingenuity and generosity some people show. Of course making the Layer Comps was the way to go! This worked perfectly and I am deeply grateful. This is going to make our workflow SO much easier. Mike, if you'd accept remuneration I'd really like to compensate you in some way. Please contact me directly to discuss.

But in the meantime please accept my sincerest thanks.

All the best,
Mike R.

Michael Rothenberg
Peak Productions


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]