Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Save layers in file named LayerSet

Community Beginner ,
Dec 27, 2018 Dec 27, 2018

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)

savegroup.png

summarizing i need to save Layer1, Layer2, Layer3 in file named Group1

Thanks for answers in advance!

TOPICS
Actions and scripting
522
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Dec 27, 2018 Dec 27, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 27, 2018 Dec 27, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 06, 2019 Jan 06, 2019
LATEST

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)

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines