Skip to main content
Known Participant
September 23, 2025
Question

How to prevent alerts or confirms to remain open?

  • September 23, 2025
  • 3 replies
  • 142 views

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?

3 replies

Legend
September 23, 2025

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

dev102Author
Known Participant
September 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. 

Legend
September 23, 2025

You are doing something wrong.

Stephen Marsh
Community Expert
Community Expert
September 23, 2025

You need to provide code.

dev102Author
Known Participant
September 23, 2025

The code is always the same

 

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

    throw new Error();

}

 

// Otherwise proceed

Stephen Marsh
Community Expert
Community Expert
September 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

 

dev102Author
Known Participant
September 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.