Copy link to clipboard
Copied
I would like to do some cleanup if user closes my panel, for example, by clicking on an icon or by selecting "Close tab" option in the fly-out menu.
Is there any event I can listen to in Adobe Photoshop or, maybe, on the panel html itself?
I have tried "body.onunload" – didn't work.
Copy link to clipboard
Copied
Some details can be found here: com.adobe.csxs.events list
Copy link to clipboard
Copied
You may have some luck with:
document.body.onbeforeunload = function () { /* ... */ }
But be aware that no Photoshop actions can be performed – e.g., you can't alert() something. But it seems to be working for Panel-only stuff, e.g. csInterface.openURLInDefaultBrowser().
Probably it gets called after the Panel has dropped the messaging system with the Host App.
Davide
www.ps-scripting.com
Copy link to clipboard
Copied
Thanks
So far com.adobe.csxs.events.WindowVisibilityChanged seems to work fine, it's triggered when user presses on the panel icon or closes panel tab
Find more inspiration, events, and resources on the new Adobe Community
Explore Now