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

Error: Cannot handle the request because a modal dialog or alert is active.

Contributor ,
Sep 23, 2022 Sep 23, 2022

Copy link to clipboard

Copied

While running the script in indesign from extendscript, this error shows! "Error: Cannot handle the request because a modal dialog or alert is active." How to fix this error. I closed the dialog box and also no alert box is active while running the script.

TOPICS
How to , Scripting

Views

131

Likes

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
Community Expert ,
Sep 23, 2022 Sep 23, 2022

Copy link to clipboard

Copied

Does it happen on some other machine as well with the same code? There are two possiblities

  • The InDesign installation or machine setup has an issue. I have seen this error reported before as well on the forum so it could be more than the script
  • The script code is causing this and it happens anywhere this code is executed. To figure this out test on a different machine as well. If this turns out to be the case then share the code here so that we all can collectively discuss over it or else you can try to figure out what is causing the issue by commenting out portions of code.

-Manan

Likes

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
Contributor ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

Thank you @Manan Joshi for your suggestion and reply! I tried in another machine but not working for me. But I found a way to ignore that error!

 

I get this error when i try onClick events, So simply ignored onclick events and by closing the Ui Dialog window  after receiving the inputs and then passing over to nextLine of script working fine! So I enabled cancel button alone to exit the script and ignored Ok button function. on very nextline I simply closed the window using "win.close()" function.  

 

Likes

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
Advisor ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

LATEST

In JS:

 

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract

 

VBA will be similar. 

Can automate anything - as long as it doesn't require A.I.

Likes

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