BEFORE close event

I’m able to add a Notification Listener to the document “close” event. But I’d like to get access to the “beforeClose” as is available in Adobe InDesign (via ExtendScript). Is that something that exists or is planned?

Here is what I’m using to call a function on the close event:

require('photoshop').action.addNotificationListener([ { event: "close" } ], psDocumentEvents_onClose);

where “psDocumentEvents_onClose” is a function that gets the event and some document details (alas, not enough details).

By the time “close” happens, the document is already closed. I’d like the opportunity to do things before it closes.

jsw

2 Likes

Agreed, would be helpful for some uses.

Would also be nice to have a similar onClose event when exiting PS itself to manage cleanup if needed.

2 Likes

Can’t find it now, so maybe I was only thinking it and never posted :smiley:

IMO all events MUST have a before{Event}. There may be lots of use cases. Maybe you want to save a snapshot before deleting a layer. Or maybe you want to do some stuff before creating new layer group, or before you move the layer.

1 Like