Photoshop closing event

I currently am listening to the closing event which fires when a document is closed. I determine if there are no remaining documents and do what I want to do. However, I want it to only do this if the application is closing and not when all documents are closed. Is there an event I can attach to?

What’s the use case? Why last document close is not enough? AFAIK there’s no event for app close (I assume it’s because currently all events are triggered after the fact, so there’s no way to trigger event after app is already closed)

Correct, there’s nothing like an onAppClose event. Actually, UXP doesn’t provide Photoshop events à la CEP, like documentAfterActivate etc. I’ve brought up this internally, and I hope they’ll be implemented soon(ish).