Naming files with variables on Export from Photoshop

I'm working with a Photoshop file which has many (hundreds) of layers which all interact with each other using a Lighten blending mode. I've written a Photoshop action that turns the top layer off and moves to the nest layer in the stack. I use F16 for that.
Each time I do that I want to Export a PNG file (which I have set to Ctrl Cmd Option P)

When I do that I want to increment the filename automatically, so starting at 0001 and eventually ending up at 9933 (!).

I assume I need to use a variable and a calculation, but I'm afraid that sort of thing makes my brain go a bit fuzzy. I get the principle but diving in is not my forté.

Does anyone have some tips?


An night's cogitation and I have found an answer which will still use a bit of KBM.

Rename Layer
Export as PNG
Turn of Layer and Go to the next Layer down

rinse and repeat xxx times.

I'd still be interested to know if a variable could be used for filenaming like this, cos then I might learn something :smile:

Create a variable, format it with your desired leading and add a +1 to increment it whenever necessary:

Hope this helps!

Ah fantastic, thank you :slight_smile:

I use two insert text date formats
%ICUDateTime%dd/MM/yyyy HH:mm:ss% for emails etc

%ICUDateTime%yyyyMMdd HHmmss% for file names to be unique

the latter I append when renaming a file

so I type
new file name adffadsadf then zxdf which is the trigger to insert %ICUDateTime%yyyyMMdd HHmmss% at the end

similarly in an email i type zxdt at that inserts the time stampt