Im trying to make a set of certificates and I have each name on a different layer. I want to export each certificate with a deferent name with the template being the same.
This can be done by scripting. I dont have time to whip up an example right now but you can use the script in how-to-do-animation-frame-pngs as a starting point. It would be quite easy to make it recognize locked layers as nontogglable entities for example.
Though it may be easier to use text variables instead a bunch of layers. See adding-individual-guest-names-to-a-wedding-invitation-in-illustrator for more info on how to do this. In either case you can toggle layers too with variables so same approach can be used with layers too its jut unnessecery work but there may be some reasons to do this such as having different fonts etc.
it is possible to use a action to toggle layer save hide layer move selection upp by one layer. But this would be a bit tedious so I wouldnt use it especially since scripting takes less time with a good scaffold as a startingpoint, but YMMV.
I don't think there is currently a tool for illustrator to systematically turn on and off a series of layers and export them individually as you envision.
I would suggest duplicating the Artboard as many times as you have different names. Then turn on one name per artboard.
At that point you would be able to export the Artboards as jpgs in a batch.