• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

On panel close event?

Participant ,
Feb 19, 2019 Feb 19, 2019

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.

TOPICS
Actions and scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Participant ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

Some details can be found here: com.adobe.csxs.events list

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 25, 2019 Feb 25, 2019

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

Davide Barranca - PS developer and author
www.ps-scripting.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 25, 2019 Feb 25, 2019

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines