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

How to schedule the closure of the message box?

Participant ,
Apr 10, 2024 Apr 10, 2024

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:");
TOPICS
Actions and scripting
331
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
Engaged ,
Apr 11, 2024 Apr 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 author
www.ps-scripting.com
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
Participant ,
Apr 11, 2024 Apr 11, 2024
LATEST

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

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
LEGEND ,
Apr 11, 2024 Apr 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.

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
Engaged ,
Apr 11, 2024 Apr 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 author
www.ps-scripting.com
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
Participant ,
Apr 11, 2024 Apr 11, 2024

Okay, thank you for your reply. I also know that this is probably not possible. Thanks.

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