4 Replies Latest reply on Oct 21, 2014 6:41 AM by Harbs.

    window.close not working on indesign cc2014

    poortip87 Level 1

      Hi All

       

      I am developing an extension for InDesign CS5 and above. I have a dialog of type panel, CSXSWindowType.PANEL which opens up on button click. This dialog contains a button for closing it. The click event executes " this.close() ".

       

      Now, the problem is that for ID CC2014 this.close() is not closing the dialog. Only the default close button at the corner of the window closes it. I have no idea why the dialog is behaving this way. It works in all the other versions.

       

      Any ideas?

        • 1. Re: window.close not working on indesign cc2014
          poortip87 Level 1

          I went ahead and wrote the below code for close button handler,

           

          var openedWindows:Array = NativeApplication.nativeApplication.openedWindows;
          var i:uint;
          var count:uint = openedWindows.length;
          for(i; i < count; i++)
          {
            openedWindows[i].close();
          }
          

           

          This closed the parent application, but the dialog Window remained as it is..

           

          What is happening? Is this a bug with Adobe?

           

          What alternative do I have if I want to open another dialog?

          • 2. Re: window.close not working on indesign cc2014
            Harbs. Adobe Community Professional & MVP

            CSXSWindowType.PANEL has always been a bit funky. It hasn't even worked in all the apps. If you can make it MODAL instead, I'd do that.

             

            Harbs

            • 3. Re: window.close not working on indesign cc2014
              poortip87 Level 1

              Okay, if I change the window type to Modal, it closes okay. If window type is panel or modal-less, it doesn't close.

               

              I need my window to be able to lose focus, which cannot be possible in case of modal dialog. I am showing image preview in the dialog window by clicking on its thumbnail in the main app. I want the user to be able to change the preview by clicking on the thumbnail without closing the dialog.

               

              Everything else is okay, the close function is ruining it.

               

              Any suggestions?

              • 4. Re: window.close not working on indesign cc2014
                Harbs. Adobe Community Professional & MVP

                Any suggestions?

                I don't know how complex your UI is. If ScriptUI is an option, I'd probably go with that. Another option would be to make a separate window extension described in your manifest instead of creating it on the fly. You'd then communicate with it / launch it using CSXSInterface. (I don't know if that will help.) Lastly, you might be able to cobble something together using system native tools or Xojo and make a floating window look like it's part of InDesign when it's really not.

                 

                HTH,

                Harbs