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

Export layers to files while maintaining Group Folder structure

Community Beginner ,
Mar 30, 2020 Mar 30, 2020

Copy link to clipboard

Copied

I have 75 group folders in the layer window, each of those groups is named and contains 32 layers. I am trying to use the 'Export Layers to Files' built in script to export everything, however it is losing the group folder structure and just putting all the exported files in one folder on the had drive with really long numbers before the layer names. I need to maintain the group folder structure on export, how can I do this? I am using PS 2019 on a Mac with OSX 10.14.6 Thanks for your help in advance!

TOPICS
Actions and scripting

Views

1.6K

Translate

Translate

Report

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
Community Expert ,
Mar 30, 2020 Mar 30, 2020

Copy link to clipboard

Copied

Have a look at the script "Export Layers To Files.jsx" It seems to save file with the file name the script sets the variable "fileNameBody" to.  Add code to add the layer set name the the beginning of that variable for the file name. You may be able the use the Layer's object parent I would think the layer set name would be its parent or the container's name would be the layer set name.

image.png

The script code now looks like this:

 

 

 

       var fileNameBody = fileNamePrefix;
        fileNameBody += "_" + zeroSuppress(i, 4);
        fileNameBody += "_" + layerName;
        fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|]/g, "_");  // '/\:*?"<>|' -> '_'

 

 

 

Try adding the layer object being process Layer.parent before layerName to the variable you may need to find where layerName is set to see what layer object being processed is. You may need to add it before any sequence number if you need to sort the output folder so layer in a group sort together, I do not know exactly  how the script process the document layer stack.

 

 

The set name may not be good for  what you want to do. Like layer names do not need to be unique layer group name need not be unique there can be more the one group in a document with a name "X".

JJMack

Votes

Translate

Translate

Report

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 ,
Apr 01, 2020 Apr 01, 2020

Copy link to clipboard

Copied

LATEST

After doing some considerable digging on the old internet I found this script that does everything I needed and worked on the first try, it even functions faster than the built in script!

 

https://github.com/hsw107/Photoshop-Export-Layers-to-Files-Fast/blob/master/README.md

Votes

Translate

Translate

Report

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