Skip to main content
Participating Frequently
October 2, 2011
Question

cannot handle the request because a modal dialog or alert is active.

  • October 2, 2011
  • 1 reply
  • 2506 views

hi all

i try to use indesign product sdk CS5 using com object to open and edit document with asp.net

this error appear to me in this part of my code

            InDesign.Application indApp = (InDesign.Application)Activator.CreateInstance(InDType, true);

         

           indApp.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

         

            InDesign.Document objDoc = (InDesign.Document)indApp.Open(cstrInddFile, true, idOpenOptions.idDefault);

Cannot handle the request because a modal dialog or alert is active.\\\   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at InDesign.ScriptPreference.set_UserInteractionLevel(idUserInteractionLevels ) at _Default.Button1_Click(Object sender, EventArgs e)

thanks advance

This topic has been closed for replies.

1 reply

Legend
October 3, 2011

Even though you find scripting examples in the SDK, scripting questions are better posted in the separate scripting forum.

That said, I have also encountered this error. It means that your script is executing a statement (most of them) that can't run while a modal dialog is open.

Short from writing a plugin, you typically solve the problem by documentation and user training.

At least in Javascript you can also prevent the error if you first look at the "app.modalState" property and just not run your script, or display an alert which may actually pop up below the modal dialog.

Dirk

seko0101Author
Participating Frequently
October 3, 2011

thank you dirk but still not understand app.modalState is a readonly prop

and which documentation and user training. those in the sdk or what?

i will move this to the scripting questions

and thank you again

Sally