Error trapping for 'Save' dialog open?
I'm writing a program which will do an extensive amount of work in Photoshop, and I'm trying to make sure it's as idiot-proof as possible. Before starting the image editing code, I want to make sure the user hasn't left any dialogs open in Photoshop, so I can show them a warning and cancel the application. I have found that attempting to get any properties of the application (e.g. version, document count, build, etc.) will throw an error if the user has the 'Open' dialog showing, but if they have the 'Save' dialog open, there is no error. Is there any reliable way to determine if the user has left Photoshop in a state where it will cause problems executing code?
My script is currently written in Applescript, but will hopefully be someday rewritten in Javascript, so I'd be interested in any suggestions in either language with preference leaning towards Javascript.
