A script/action to save multiple layers

  • 1
  • Question
  • Updated 3 weeks ago
I use Photoshop to make icons for forums and like and that often means the icon has a static base but different images within the base for different uses. But when i save these, sometimes 50-100, I have to do so manually. Its monotonous work saving, naming, hiding the top image, and repeating hundreds of times. 

Ive tried setting an action to do so, but it stops after the first layer and won't name the saves in numerical order. Ive tried batches but it won't go beyond the recorded action. Export layers to files gets stuck in a loop of deleting all layers over and over. 

So is there anything I can do to basically save, name under a different name, hide or delete a layer, and repeat? 

Im using CC2015 on Windows 10 if it helps
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes

Posted 3 weeks ago

  • 1
Photo of Johan Elzenga

Johan Elzenga, Champion

  • 1399 Posts
  • 565 Reply Likes
What do you mean with "Export layers to files gets stuck in a loop of deleting all layers over and over."?

I have tried it with a layered document (though not 50-100 layers) and everything works as expected. Each layer is saved as a file, nothing gets deleted. By the way, why are you still using CC2015 and not CC2018? This could be a bug that has been dealt with.
(Edited)
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes
So I dropped the 200 layers to just 5 to test and it was actually doing what it was supposed to do, just with so many layers, it was taking a long time and i never let it finish. 
But when saving it, it saved the layers separately. 

There is a static base layer that i have the images clip masked to, then a top layer that is static as well. I want to automate the process of saving the file as a PNG > clear or hide the top image layer > save as PNG > ect

Also, I cant afford CC18 :/
(Edited)
Photo of Johan Elzenga

Johan Elzenga, Champion

  • 1399 Posts
  • 565 Reply Likes
What do you mean you can't afford CC2018? If you are using CC2015, then that means that you have a subscription. And that means that CC2018 is a free upgrade...
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes
Because of reasons that may not be morally ok 
Photo of Johan Elzenga

Johan Elzenga, Champion

  • 1399 Posts
  • 565 Reply Likes
Using a pirated copy is indeed not morally OK. Asking help with your pirated copy on an official Adobe website is even more not OK.
Photo of Kukurykus

Kukurykus

  • 305 Posts
  • 46 Reply Likes
I think you scared him as he didn't posted video of his problem in other sub-theard :)
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 781 Posts
  • 166 Reply Likes
What about select all layers > right click on layer in layers panel > export As..
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes
I tried it and it separates all the layers. 

I have a 2 static bases, one on the top layer and one on the bottom. The images i want different are in between and clip masked to the bottom layer. 
Photo of Kukurykus

Kukurykus

  • 309 Posts
  • 46 Reply Likes
There is not any problem to do all you described. If you can not do it yourself for some reason perhpas sharing uploaded psd file with some quiantity of layers you would like to export let me or someone to check it and suggest what you were doing wrong or why it didn't work...

That's important you to post some image that illustrates relation between layers as now it's really hard to me to imagine it the way that can be constructed.

If it's really specific task it can be solved by a script doing exactly that you want.
(Edited)
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes
HERE is a screenshot of my workspace with layers labeled. 

If this isnt enough, is sharing a google drive link allowed here?
Photo of Kukurykus

Kukurykus

  • 309 Posts
  • 46 Reply Likes
Yes it is allowed from that I saw last months.

Using this this screenshot as example can you say which layers had to be saved together as .png, I guess one static like (1 Shape Copy 3) with some other(s)? and so on?

It's better you gave some sample with whatever content to test it. Also like in the above said what should be exact outputs from provided layers.
(Edited)
Photo of Bryce Eldridge

Bryce Eldridge

  • 6 Posts
  • 0 Reply Likes
Link  This is a mock-up of what I want to do, just on a smaller scale. 

But the top 3 layers are in a group, and the shown bottom 2 layers are the static layers that will not change from save to save. 

The images in between are the ones that change. The top image gets saved, then removed and the next layer is not visible. That layer gets saved and removed. Rinse and repeat.

If Im not explaining it, Ill record a video of what I do manually so you can get an idea of what i want to do with actions or whatever is needed. 
Photo of Kukurykus

Kukurykus

  • 309 Posts
  • 46 Reply Likes
I think that you do is the easiest using 'File / Generate / Image Assets'. This way you can export .png's while creating them.

Surely I don't understand fully your description so more appropriate would be to make a video.

I don't know which layer you're calling as TOP. is that the first fo those 'between'? And when saved and removed why the next one is going to be invisible if also saved and removed? Just make video.

If that will need a script then tell me what is your name on regular Adobe Photoshop fourm. Mine is Kukurykus where you can send me a message with your E-mail I'll send back a script (if needed), as here private messages are disallowed as well as posting e-mail addresses.
(Edited)
Photo of Warren Heaton

Warren Heaton

  • 99 Posts
  • 34 Reply Likes
You can do what you're looking for with the Layer Comps panel and File > Export > Layer Comps to Files....
(Edited)