1 Reply Latest reply on Nov 27, 2012 1:11 PM by TheDollarBill

    Closing a modal dialog

    TheDollarBill Level 1

      I have an extension that runs in illustrator.  It runs invisibly in the background listening for an event from an illustrator SDK plugin.  When the event is received a modal dialog is popped. When the user clicks the submit button of the modal dialog I need to close the dialog.  If I use this code:

      CSXSInterface.getInstance().requestStateChange(StateChangeEvent.WINDOW_CLOSE, null);


      The extension no longer listens for the event and will not pop-up anymore.  If I simply do a "close();" from within the modal dialog then the extension will continue to listen for the events, BUT the dialog will stay on the screen in some cases where large files are being delt with.


      Any ideas?

        • 1. Re: Closing a modal dialog
          TheDollarBill Level 1

          I am pretty sure there's some kind of bug on Adobe's end.  Plenty of their samples use the "close();" function to dismiss a modal dialog.  When I use it, some machines get stuck and won't allow the modal dialog to be cleared unless you hit the escape key.


          Speaking of which.  Is there any way to programmatically hit the escape key?  That's the only way I can think to make a work around for this issue.