Handling photoshop popups

Hi everyone :slight_smile:
I’m currently working on a plugin that part of its job is to go over all files under a folder given by the user.
It looks for png files, opens each one, performs certain operations, saves, and closes.
It might have to handle hundreds of files, if not more…

Most of the files are processed successfully, but for some photoshop shows this window:

Is there a way I can handle this from the code? Or is there perhaps a way to avoid it altogether?

I would check that file and see if there is something strange with it.
Or, perhaps the steps your code performs caused some change in the document that cannot be saved in png format.
Flattening the image before saving might help if that is the case.