8 Replies Latest reply on Feb 7, 2013 12:53 AM by Laubender

    [JS] ScriptUI problem CS5

    Roy Marshall Level 1

      I am buiding a User interface window, using the palette Window item.

      Screen Shot 2013-02-06 at 4.34.22 PM.png

      The buttons call functions to do things which work fine in isolation.

      however, when the function is called from this palette, (I am using a dialog Window item)

      Even using a simple prompt alert, the same thing happens.

      Screen Shot 2013-02-06 at 4.38.02 PM.png

      the contents of my palette are wiped out.

      Screen Shot 2013-02-06 at 4.38.06 PM.png

      I dont know if I am using the correct targeting method:

      #target indesign;

      #targetengine "session";

      as maybe the window sesions are clashing.

      I can supply more code if required.


      Any help gratefully recieved!



        • 1. Re: [JS] ScriptUI problem CS5
          Trevorׅ Adobe Community Professional

          Hi Roy


          First try changing the targetengine to something unique-ish like

          #targetengine RoyMarshal

          as you might well be right about a clash.

          If that does not work then post some more code.



          • 2. Re: [JS] ScriptUI problem CS5
            Roy Marshall Level 1

            Hi Trevor.

            Thanks for the reply.

            Unfortunately that didn't help.

            I am pasting below the code (not the actual code, but a stripped down version) and you can see the problem.


            #target indesign;

            #targetengine roymarshall;



            var pnBriscoesWindow = new Window('palette',"Test Panel");

            var pnTabbedPanel = pnBriscoesWindow.add('tabbedpanel');

            var pnTabOne = pnTabbedPanel.add('tab',undefined,'Savers');

            var pnTabtwo = pnTabbedPanel.add('tab',undefined,'Formatting');

            var pnTabThree = pnTabbedPanel.add('tab',undefined,'Image Control');



            var pnRow1 = pnTabOne.add('panel', undefined, "Saver Setup");

            var pnBriscoeLabelSaver = pnRow1.add('button', undefined,'Name the Selected Saver');

            pnBriscoeLabelSaver.onClick = function(){





            var pnRow2 = pnTabtwo.add('panel', undefined, "Formatting the Page");

            var pnFormat = pnRow2.add('button', undefined,'Run the Formatting Script');

            pnFormat.onClick = function(){





            var pnRow3 = pnTabThree.add('panel', undefined, "Image Control");

            var importSafari = pnRow3.add('button', undefined,'Import the Safari Image');

            importSafari.onClick = function(){








            function labelTheSaver(){

                      myText = prompt("Test Box", "Text here");




            function pageFormat(){

                      myText = prompt("Test Box", "Text here");




            function importImageOpenedInSafari(){

                      myText = prompt("Test Box", "Text here");


            • 3. Re: [JS] ScriptUI problem CS5
              Trevorׅ Adobe Community Professional

              Hi Roy


              works for me on windows 7

              I presume that you left out   pnBriscoesWindow.show()  just on the posting?


              By the way I can't remember if I ever asked you if you'r connected to a Roy Marshall who was my father's print factory manager in Garrick Street and in Kings Cross from about 40 to about 20 years ago?

              • 4. Re: [JS] ScriptUI problem CS5
                Roy Marshall Level 1

                Hi Trevor.

                pnBriscoesWindow.show() is there, just before the functions at the bottom.

                So, it works on Windows....Thats anoying!

                I will keep looking into why it is not working for me.

                Anyway, No, I am (or I am not connected) to that Roy Marshall. I was however a Studio Manager in a Prining factory back in the UK but the a coastal town of Chichester. I left there to come to New Zealand about 5.5 years ago.

                Strange eh?

                Thanks for looking into this anyway



                • 5. Re: [JS] ScriptUI problem CS5
                  Trevorׅ Adobe Community Professional

                  Yes these Mac Window issues are a big pain in the neck to fix up.


                  I made the mistake about the show() because I had ID5 and ID6 both open and after running the script looked at the wrong ID, I then without looking to carefully at the script added show() run the script and then looked this time at the correct ID and lo and behold it appeared


                  Well I often thought that it's a good thing I'm not programing for a nuclear power plant.


                  Good luck



                  • 6. Re: [JS] ScriptUI problem CS5
                    Roy Marshall Level 1



                    I just did a test on CS6, and it works OK. My client is on CS5 though, so this doesn't help me much



                    • 7. Re: [JS] ScriptUI problem CS5
                      Trevorׅ Adobe Community Professional

                      I retested the script on CS5 on windows and also get a problem




                      The tabbed panel displays properly at run up but after clicking OK on a prompt it goes blank like on your screen shot.

                      • 8. Re: [JS] ScriptUI problem CS5
                        Laubender Adobe Community Professional & MVP

                        The problem is not restricted to MS Windows.
                        Same thing here on OSX 10.6.8 with InDesign CS5 v7.0.4.


                        NO problem with InDesign CS5.5 v7.5.3 !