Copy link to clipboard
Copied
Hello! I am using Export Layers To Files.jsx from here: https://gist.github.com/davestewart/4529727
What i need to do - Save all layers in file named by LayerSet (in my screenshot Group1)

summarizing i need to save Layer1, Layer2, Layer3 in file named Group1
Thanks for answers in advance!
Copy link to clipboard
Copied
So all layers will get group.jpg name? if all of them have one name then you'll have only one of three desired files?
Copy link to clipboard
Copied
No, i need to all layers will get they're names (ex. Layer1.jpg, Layer2.jpg, Layer3.jpg), and i want to save that files in folder named Group1.
Sorry for the mistake
Copy link to clipboard
Copied
You can use this primitive method for given circumstances:
sTT = stringIDToTypeID, jpg = new JPEGSaveOptions()
jpg.quality = 12, set = (aD = activeDocument).layers[0]
Folder(folder = '~/desktop/' + set.name).create()
for(i = 0; i < set.layers.length;){
nme = set.layers[i++].name
ref = new ActionReference(), lst = new ActionList()
ref.putName(sTT('layer'), nme), lst.putReference(ref);
(dsc = new ActionDescriptor()).putList(sTT('null'), lst)
dsc.putBoolean(sTT('toggleOptionsPalette'), true)
executeAction(sTT('show'), dsc)
aD.saveAs(File(folder + '/' + nme), jpg)
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now