In this case you should get a Close event, with a saved path & format, if necessary. You have to handle these too.
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?
You have to parse the close event's descriptor. Look for keySaving key
Thanks Ilya! I got what information I wanted by capturing the close event and getting info from the descriptor.