I have to perform some actions on the save event of a document. I had no problem in doing the same. But, during testing different save event trigger scenarios, I came across the a situation in which an untitled document is open and the user closes Photoshop. At this point Photoshop prompts the "Do you want to save document?" message. Regardless of the user selection ("Yes"/"No"), the plugin is unable to get the save event, possibly because of application shutdown. I get the kSPInterfaceShutdownSelector message directly. No stop at the save event callback.
How can I ensure that my save event callback is executed everytime a user saves a document?
I put in event listeners for close event, save event. I receive a call at the close event call back function. There I tried to get the saved document name, but I get none since the document has been closed. I need the saved document name to do my work. After the close event call back function, the call goes straight to shutdown plugin. The save event callback is missed totally. Why is this being done?
The same is being done if I close an unsaved document without closing Photoshop. I am presented with a "Do you want to save?" prompt. If I choose "Yes", then the plugin just receives a call at the close event callback. No call received at the save event callback.
What can I do?