Here is my script:
But I do not think my code is the cause ...
I would like to share another concern.
So my script works for hours, and despite the use of the command "app.purge (PurgeTarget.ALLCACHES)" Photoshop eventually crash putting me the message "Not enough memory to preview" (I do not know the exact message in English, I have a French version).
There is no error code, and I tried to isolate my loop in a try / catch, but even so the error is crashing my script.
I turned off the preview of the layers in the Layers palette, the script runs a little longer, but still ends by crashing.
Windows? Are you crashing? Do you have to force quit Ps? Are you running any third party plugins?
Sounds like you are having errors with a dialog.
Can you get me a dump file? http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx