I often use the Export > Layers to Files script. Obviously it's ancient (2007), and therefore has no support for the more recently introduced Artboards.

When using the Layers to Files script, it outputs the layers using the dimensions of the entire canvas. On a file with multiple artboards, that means the image dimensions are completely wrong.

Is there an existing script that can handle exporting layers to files, when they are within an artboard?

Or is there any other way to achieve the following:

  1. Document has one or more artboards
  2. Each artboard has layers, named according to what the filename should be on export
  3. User can select the layers for export
  4. Export the layers, to the dimensions of the artboard they are within, ideally allowing for use of the artboard name and/or layer name and/or a prefix entered during the export process.

Typically I am exporting to JPG. Although if there's a solution out there that supports PNG or multiple formats, I'd love to see it.

I am fine with only performing this on layers from one artboard at a time. No issue there.

I am fine with a less than ideal naming process, although I like the fact the existing Layers to files script allows for a prefix and will use the layer name in the filename.

(Ideally, it would also be possible to export Groups (their visible layers would get merged in the process) within Artboards, whilst also over-coming the same canvas size issue I am facing with exporting layers. I am still looking into existing solutions for Groups to files scripts, and will post a separate question if I can't find a solution.)

Any suggestions?

Thanks very much.

1 Answer 1


How about using Generate Image Assets instead? This feature is amazing but often overlooked.

  • Enable it from the menu File > Generate > Image Assets;
  • Rename layers/groups/whatnot to file names and, optionally, add size variables;
  • Generate will pickup those and export them instantly;

An example. My setup: 2 artboards, some groups and layers:

  • The bottom group is called 50% hello.png, 200% hello.jpg — meaning Generate will export the content of this group as two files: x2 smaller png and x2 larger jpg;
  • another layer is called letter_b.png — just a layer to file. It has a layer mask so that Generate won't cut the layer using its transparency but retain the canvas size;
  • and another group artboard_2.jpg on a different artboard — a jpg file is expected;

enter image description here

Result of the export:

enter image description here

Note how A-images was trimmed by transparency and B has the same canvas size as the artboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.