Skip to main content
Known Participant
April 10, 2024
Question

How to schedule the closure of the message box?

  • April 10, 2024
  • 2 replies
  • 507 views

In Photoshop script code, I want to pop up an alert message box, and I hope to close this message box 10 seconds after it pops up, or implement it with a modal dialog box. However, there is no timer under the modal dialog box. How can I achieve this functionality?

alert("Hello", "Prompt:");
This topic has been closed for replies.

2 replies

Legend
April 11, 2024

In Photoshop, all Extendscript windows are modal. Window.alert, Window.prompt, and Window.confirm halt the calling routine though, so no more code can be executed while one of those is on screen. This means there is no way to internally have code to close the dialog box.

Davide_Barranca12040269
Legend
April 11, 2024

Sorry, in ExtendScript for "modal dialog" I meant a "ScriptUI modal dialog". That one I'm rather certain you can programmatically close.

Fun fact: in UXP, alert() is available only in debug mode 🙂

 

Davide Barranca - PS developer and authorwww.ps-scripting.com
Davide_Barranca12040269
Legend
April 11, 2024

As far as I know, you can't operate on `alert()` as you'd like to. Are you using ExtendScript or UXP?

Either way, you can pop a modal dialog up and programmatically close it.

 

Davide Barranca - PS developer and authorwww.ps-scripting.com
Known Participant
April 12, 2024

First of all, thank you for your reply. I am using ExtendScript