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

How to prevent alerts or confirms to remain open?

Explorer ,
Sep 23, 2025 Sep 23, 2025

In my script, I have some alerts and confirms (e.g. if I detect a problem, I may use a confirm to ask the user if they want to proceed). Now, often this works well, but sometimes the confirm dialogs remains open after I click "yes" or "no". I suppose this is similar to my other problem. I tried to place a app.refresh() after some of those dialogs, but the issue still happens.

 

Do you know how to definitively solve this issue?

TOPICS
Actions and scripting
96
Translate
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
Explorer ,
Sep 23, 2025 Sep 23, 2025

I forgot to mention (and there doesn't seem to be a way to edit the posts).

 

I'm using ExtendScript.

 

I'm on a MacOS Sequoia and using Photoshop 26.9.0.

Translate
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
Community Expert ,
Sep 23, 2025 Sep 23, 2025

You need to provide code.

Translate
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
Explorer ,
Sep 23, 2025 Sep 23, 2025

The code is always the same

 

if(!confirm("some message")) {

    throw new Error();

}

 

// Otherwise proceed

Translate
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
Community Expert ,
Sep 23, 2025 Sep 23, 2025

Without context, it's hard to comment on the snippet. The dialog closes for me using your snippet.

 

Your other topic uses scriptUI, which is more complicated than native system prompts/alerts/confirms.

 

https://theiviaxx.github.io/photoshop-docs/ScriptUI/Window.html

 

Translate
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
Advocate ,
Sep 23, 2025 Sep 23, 2025

Post.Your.Scripts. We can't help without seeing the code.

Translate
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
Explorer ,
Sep 23, 2025 Sep 23, 2025

Yes, I know that in theory the confirm window should close. That's why I'm asking this question. If it happened to anyone else. 

I will not post my scripts obviously. If I wanted to post them, I'd already. 

Translate
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
Advocate ,
Sep 23, 2025 Sep 23, 2025
LATEST

You are doing something wrong.

Translate
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