I have a source file for an icon. It has a base layer which is the icon background, and a number of layer folders, each of which contains layers for each individual icon. There are 20 or so of these folders. To save the icon set, I need to:
I've played around with the scripting in Photoshop but haven't been able to make something that does this automatically (it's an annoyingly time-consuming operation). Is it possible?
Yes! Here's what you do. Open the Layer Comps window in photoshop. Click the snapshot button, hide your current layer, show the next layer, click the snapshot again. Create a layer comp snapshot for each state of your document that you want to have exported as individual files. Once you have all of those ready, go to File > Scripts > Layer Comps to Files. Set up your destinate folder and image settings, then export and you will have all of those layer comps as single images.
Photoshop Composition Composer will do just what you need. In your case use only a single top-level folder.
File > Scripts > Browse...
Note: use prefix
__ (double underscore) for top-level group names to exclude groups from the composition composing process. E.g.