RecursiveExport

December 15, 2024 · View on GitHub

Simple plugin for Sketch.app to recursively export exportable layers in a selected naming scheme. I was surprised it didn't exist so I wrote it. If anyone knows an easier way to do this let me know.

What it does

When selecting a layer in your canvas and running the script, the script will prompt for an export directory and a desired export structure. Then it traverses your layers and exports each layer that has been marked exportable in all of the export formats defined for that layer 1.

Install

  • Download the plugin from the Releases tab in this repo.
  • Unzip and doubleclick on the .sketchplugin file to install.
  • It should now appear in Sketch.app under the menu item Plugins.

Screenshots

So given

Screenshot 2024-12-14 at 11 14 45

It asks

Screenshot 2024-12-14 at 11 01 22

And exports either

Screenshot 2024-12-14 at 11 15 15

or

Screenshot 2024-12-14 at 11 16 45

or just a plain list of files named the same as the layer.

But you can do the latter without the plugin, just in Sketch > File > Export

Footnotes

  1. It does apply the prefixes and postfixes defined in the export format, but it ignores the size settings. If anyone can get that working, let me know.