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

UXP modeless dialog

Community Beginner ,
Dec 04, 2022 Dec 04, 2022

Hello!

I am a software developer, but know relatively nothing about InDesign. I was tasked with creating a script to export all the text from a document.

So far I have created a UXP script that does this but it take a long time to run so I wanted to show a progress bar in a non-modal dialog. 

I've seen examples of scripts that use the new Window() constructor, but this doesn't seem to be supported in UXP... so my question is, how can I display a non-modal dialog so I can show some sort of progress as my script runs?

 

Thanks!

David

TOPICS
UXP Scripting
1.4K
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

correct answers 1 Correct answer

Advisor , Dec 04, 2022 Dec 04, 2022

Hello @David272945657vhz,

 

Take a look at the link below to see if it points you in the right direction...

https://developer.adobe.com/indesign/uxp/uxp/reference-spectrum/User%20Interface/sp-progressbar/

 

Regards,

Mike

Translate
Advisor ,
Dec 04, 2022 Dec 04, 2022

Hello @David272945657vhz,

 

Take a look at the link below to see if it points you in the right direction...

https://developer.adobe.com/indesign/uxp/uxp/reference-spectrum/User%20Interface/sp-progressbar/

 

Regards,

Mike

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 Employee ,
Dec 05, 2022 Dec 05, 2022

Hi David,

 

When you say a non-modal dialog, do you mean like, a panel that persists on screen?

 

When it comes to UXP scripting in InDesign,  panels or plugins have not been enabled yet, but they are scheduled to roll out in 2023.

 

You could make a non-modal dialog by building a CEP panel... but it's not as easy, due to the use of much older JavaScript, (among other things).

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
Community Beginner ,
Dec 05, 2022 Dec 05, 2022
LATEST

Hi Erin,

I'm not sure about a Panel, that sounds like an integrated component. I just meant a regular dialog but non-blocking, basically I need my script to keep running without waiting for the dialog to be dismissed.

 

What I ended up doing was creating a dialog as mentionned here: https://developer.adobe.com/indesign/uxp/reference/uxp-scripting-samples/ instead of using app.dialogs.add(), and I called show() instead of showModal().

 

So far this seems to work. I am only updating some text but I should be able to add the sp-progressbar as Mike mentioned.

I also needed to add some fake sleep using setTimeout() to allow the UI to update.

 

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