Script to export Layers to PNGs, in a special way

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Howie Day

Script to export Layers to PNGs, in a special way

Post by Howie Day »

Hey, guys! I'm looking for a script that would export either all layers in a photoshop file, or the selected layers in a very specific way.

I need to treat each layer group as a directory with each exported layer trimmed to the extents of its source layer group. The exported PNGs need to have transparency. I'm using CS5, on a 64bit windows 7 machine.
So if I had a PSD laid out like so:

TestDir (layergroup)
|-Set_01 (layergroup)
...|-Frame_01 (layer)
...|-Frame_02 (layer)
...|-Frame_03 (layer)
...|-Frame_04 (layer)
...|-Frame_05 (layer)

the resulting export directory will look like this:

(Set export directory)
|-TestDir (Directory)
...|-Set_01 (directory)
.....|-Frame_01.png (Trimmed to the size of the Set_01 layer group)
.....|-Frame_01.png (Trimmed to the size of the Set_01 layer group)
.....|-Frame_01.png (Trimmed to the size of the Set_01 layer group)
.....|-Frame_01.png (Trimmed to the size of the Set_01 layer group)
.....|-Frame_01.png (Trimmed to the size of the Set_01 layer group)

My current PSd file has 500 of these layers/layer groups and its taking an excessive amount to time to do this. I'm hoping someone can help me!

Thanks in advance!