I have a very long action that generates over 100 PNG images using frequent "Save As" commands. I use Automate > Batch to perform the action, and have chosen "Document Name" + "3 Digit Serial Number" + "Extension" as the File Naming option.

The problem is, instead of appending the serial number each time, it instead adds it to the filename every single time. So instead of FileName001, FileName002, FileName003, etc. I get something like this:

  • FileName001.png
  • FileName001001.png
  • FileName001001001.png
  • FileName001001001001.png

Eventually, the name gets so long that it goes over the path length limit and throws an error.

The name of the files doesn't matter, just so long as they're unique and able to export successfully.


3 Answers 3


You could try the following:

Instead of editing and exporting the image every time, try to add a layer with the current flatted image to a folder inside the PS file (you can do that in your automated job).

After the entire image is processed, the folder containing the layers has all the images that need exporting.

You could manually remove the other layers -> don't forget to put them back though!

Export that folder's contents with a script: example script can be found here

I believe that script will export all the layers without the funky name length.


I tried to figure out the specifics that would result in your exact situation, but without further information, I couldn't quite do it. However, I really think it might be resulting from you including a "File Open" or a "Save As" command (or both) in the action that your applies as it processes the images.

Because the batch process is designed to open an image, perform a specific action on that image, and then save the image with a specified name, in your situation, it seems as if it might be opening the same image over and over and renaming it.

You can check this by opening your Actions folder, and looking at the steps included in the action you are including in your batch process. If the first step is something like "Open" that is probably what is causing the problem.

I did a quick test using one of my User Created Actions inside a batch process with the same naming conventions that you used, and it seemed to work perfectly. Here is a picture of my actions panel--at the very bottom is the "Export as JPG" action. This is the one I used in my batch test.

This action is designed to open a high-resolution image, and resave it as a medium quality jpg. It was created for use on an open image, and you can see it begins with the "Save" command. Because it is using the "Save" command and not the "Save As" command, it captures the quality settings, but does not include any naming information, so it doesn't interfere with the Save As/Renaming function that is built into the Batch process.

enter image description here

You can check and see if there are any problematic commands in your action by opening up the action panel, and then clicking the down arrow on your action to show all of the steps. If you find a problematic step in the action, you can actually remove individual steps from an action by choosing the step, and then clicking on the garbage can at the bottom. That can save you from having to recreate your entire action.


Here are the settings I used, and the export to show you the final files. I have CC 21.2.2

I could not get it to replicate the problem that you are seeing, so I would make sure you have all your updates for Photoshop in case it's a bug. If you're still having problems, post a screenshot of your export settings.

Batch settings

final file list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.