I'm trying to export separate layers too. So far, I have the script below, and it's working OK. It exports only named layers. The script is so simple, I'm amazed this function is not built in!

If...