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

How to schedule the closure of the message box?

Explorer ,
Apr 10, 2024 Apr 10, 2024

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:");
TOPICS
Actions and scripting

Views

264

Translate

Translate

Report

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

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.

 

Davide Barranca - PS developer and author
www.ps-scripting.com

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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 🙂

 

Davide Barranca - PS developer and author
www.ps-scripting.com

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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