Layer Sets to Files script

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

garek007

Layer Sets to Files script

Post by garek007 »

Anyone know if someone has made a script that will convert each layer set to a separate file, using the name of the set as the filename? I did a search, but had no luck.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Layer Sets to Files script

Post by Mike Hale »

This should get you started.

it assumes the activeLayer is the layerset you want to save. I left the saving up to you

Code: Select allvar doc = app.activeDocument;
var myLayerSet = doc.activeLayer;
var newName = doc.name + "_" + myLayerSet.name;
var newDoc = app.documents.add(doc.width, doc.height, doc.resolution, newName);
newDoc.activeLayer.isBackgroundLayer = false
app.activeDocument = doc;
myLayerSet.duplicate(newDoc);
app.activeDocument = newDoc;
garek007

Layer Sets to Files script

Post by garek007 »

Thanks,

I figured someone may have already put one together, not that I'm lazy, but no reason to do extra work if someone is sharing. Doesn't look like it though, so I'll start with what you gave me and make my own. Thanks!
garek007

Layer Sets to Files script

Post by garek007 »

Here's a basic version. Nothing fancy. Later if I have time I'll add more functionality to it like turning on all layers and auto selecting top layer. As it works now you'll need to select topmost layerSet yourself and make sure all layer sets are in order and visible. Then run the script.

Also, if anyone tries it, let me know if it ain't working right.