7 Replies Latest reply on Oct 21, 2015 8:28 AM by Bill McLean

    Does El Capitan OS X cause problems with script driven dialog boxes?

    Bill McLean Level 1

      When running the folllowing with OS X El Capitan

       

      Running a very simple test:

       

      var w = new Window('dialog', 'Descriptions');

      btn = w.add('button', undefined, 'close'); 

      btn.onClick = function() { 

          w.close();

       

         // the window should be closed when the alert is pops up.

          alert('foo’);

       

       

      }

      w.show();

       

      // the window

      var a = 10;

       

      var c = 10;


      WIth EL Capitan it does not close the dlalog or the alert until the script completes running.



        • 1. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
          Trevorׅ Adobe Community Professional

          This is the normal way to do it.  It has nothing to do with El Captain.

          var w = new Window('dialog', 'Descriptions');
          var doMyStuff = false;
          btn = w.add('button', undefined, 'close');
          
          btn.onClick = function() {
              w.close();
              doMyStuff = true
          }
          w.show();
          
          if (!doMyStuff) exit();
          
          alert('foo');
          
          // the window
          
          var a = 10;
          var c = 10;
          

           

          HTH

           

          Trevor

          • 2. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
            Bill McLean Level 1

            Agreed that is the correct way of doing it.  The problem did occur wth 11.1.0.122 build with El Capitan.  There was InDesign update today that corrected the problem, so the above code now works correctly!  Yesterday, it would display 'Descriptions' dialog even after the w.close(); was executed. Which is the wrong behaviour.


            Ergo, the question.

            • 3. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
              Laubender Adobe Community Professional & MVP

              Hi Bill, as far as I know, the update of InDesign was for the DPS Desktop Tools.
              The current version number is still 11.1.0.122. I think, your problem was fixed in a different way.
              Or do you see a new version number for InDesign on El Capitan?

               

              Uwe

              • 4. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
                Laubender Adobe Community Professional & MVP

                Hm, on a second thought…
                you could be right.

                 

                The update of the DPS Desktop Tools did something to the preferences of InDesign CC 2015. I had a notification on this after updating: "Startup Alert" … "Preferences are reset to default" (rough translation from my German InDesign).

                 

                Could well be that your preferences were corrupt and now after the update with refreshed preferences your script is running again.

                 

                Uwe

                • 5. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
                  Bill McLean Level 1

                  A number of other people that I know was affected by the dialog box failing to close with InDesign CC 2015 and El Capitan. It does seem that the DPS Desktop Tools update corrected the problem, albeit without acknowledgement from Adobe that there was an issue that needed correcting. 

                   

                  My concern is that Adobe should be reporting a version number change. DPS Desktop Tools are a part of InDesign and and the update has affected InDesign functionality (in a good way this time).

                  • 6. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
                    Laubender Adobe Community Professional & MVP

                    Hi Bill,

                    don't think so. The developer teams of InDesign (core) and DPS are two very different entities. And versioning is about InDesign (core). You can regard DPS nearly as a 3rd party plug-in. So DPS will affect InDesign when updated, yes. But in a way I do not like: Every time you update or install a plug-in InDesign will change its preferences to default. One indication of this is, that recent files will not show any files opened before. This time when DPS was updated, it was worse.

                     

                    After starting InDesign CC 2015.1 again after the update of DPS the following message popped up:

                     

                    Startup-Alert-Screen.png

                     

                    Could be something else, of course.

                     

                    Uwe

                    • 7. Re: Does El Capitan OS X cause problems with script driven dialog boxes?
                      Bill McLean Level 1


                      This problem has taken a large chunk of my time in the last couple of days.


                      I have been able to qualify the issue and the issue has started with the Introduction of El Capitan.

                       

                      The issue with dialog boxes not closing properly can be demonstrated by doing the following steps

                       

                      1. Open InDesign and Extend script.  Add the following to a testscript:
                           var w = new Window('dialog', 'Descriptions');
                           btn = w.add('button', undefined, 'close');
                           btn.onClick = function() {

                                   w.close();

                                   // the window should be closed when the alert is pops up.

                                    alert('foo’);

                                }

                                w.show();

                                // the window show be closed if the you set a break point here.
                                var a = 10;

                                var c = 10;
                                When running the script, will see that the dialog with the 'close' button closes before the alert dialog pops up.  This is the correct behavior.

                      2. Put the following at the top of the script:


                      #target "indesign"


                      Re run the script. You will see that the dialog with the close button does not close and the alert dialog pops up.  This is the incorrect behavior.


                      3) Remove the # target line from the script.  When you run the script again, the incorrect behavior occurs again.

                       

                      4) Closing ExtendScript  and reopening  it and InDesign will cause the correct behavior to be shown, if you re-run the script.

                       

                      5) Removing the #target is not an option for applications. If you and you try to reference the document using:

                           currentDoc = app.activeDocument;

                      current document value is undefined.

                       

                      Any clues from anyone for a workaround?