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