Skip to main content
Inspiring
August 8, 2012
Answered

How can we get save event at Photoshop shutdown?

  • August 8, 2012
  • 1 reply
  • 1681 views

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!

This topic has been closed for replies.
Correct answer ilvar

You have to parse the close event's descriptor. Look for keySaving key

1 reply

ilvar
Inspiring
August 8, 2012

In this case you should get a Close event, with a saved path & format, if necessary. You have to handle these too.

poortip87Author
Inspiring
August 9, 2012

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?

ilvar
ilvarCorrect answer
Inspiring
August 9, 2012

You have to parse the close event's descriptor. Look for keySaving key