Catch "close" event using action set or JSX script

I registered “close” event in PS. Everything works fine when user closes image by himself, but my question is - is there any way how to catch this event using action set or JSX script?

There was an option that worked but listening to universal events was removed few versions back.