Batch Export All PSB Layers Separately with Mockup Template in Multiple File Types and File Names
Hello! Not sure if this is possible or if there is a better way but would be grateful for any pointers!
I need to make exports of multiple artwork files on one candy bar mockup template in multiple formats (flat jpg rgb, transparent png rgb, transparent pdf cmyk, etc.). Multiple file names would be a plus. For example, there are 5 flavors of this candy bar that need to be mocked up, and each bar needs a flat JPG, transparent PNG, and PDF, named accordingly on the backend (-rgb, -rgb-clip, -cmyk-clip).
When I double click my smart object layer in the mockup template, my PSB file opens and I have all 5 flavors linked, each on its own layer. Currently I have to show and hide the layer, save the PSB, go back to the original mockup template, and export from there - one by one. It seems like there should be a way to automate this.
I have researched this quite a bit and found some helpful scripts that can partially do this in a different way, but they are still limited. This one in particular was made by JJMack and is good but is limited to flat jpgs (fast forward past the Figma stuff on this video, and jump to "running the script"):
https://www.youtube.com/watch?v=-t8zcTfiG7c
I'd rather avoid all the file folders though, and just use the layers in the PSB file. It's nice and tidy, and they're linked to the artwork files so that they automatically update with changes to the artwork.
Here are some screenshots if it helps.
This is my PSB file that opens up when I double click the smart object on the mockup template. You can see the layers with fronts and backs of the linked artwork for 5 candy bars:

And here it is on the original mockup template with the smart object.
I just need to batch export all of the flavors in different file formats and file names, some with transparency and some without.

I hope I didn't confuse, and glad to clarify anything. Thanks in advance for any help!
