Copy link to clipboard
Copied
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:");
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
First of all, thank you for your reply. I am using ExtendScript
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 🙂
Copy link to clipboard
Copied
Okay, thank you for your reply. I also know that this is probably not possible. Thanks.