11 Replies Latest reply on Feb 7, 2011 1:33 PM by sotospeak2009

    ScriptUI CS5

    sotospeak2009

      I have a scriptUI tabbed panel which is working fine in CS4, Win 7 or Win XP or OSX.

       

      Recently I tested with CS5 and it shows a strange problem.

       

      My panel shows regularly: I have an icon which, when clicked, opens a file dialog to choose a file. At the very moment the Windows File dialog opens I have 2 strange behaviours:

       

      1- the active tab in my panel changes from the default to the second one;

      2- any contents in my panel disappear (text, input fields, icons, everything), in both tabs, just two buttons keep their place "OK" and "Cancel".

       

      When the file dialog has closed, my panel is useless and empty, I can just click "Cancel" to destroy it.

       

      I have this same result in two different Windows 7 installations, where the CS4 version is still working fine. It seems this is not affecting CS5 on OSX.

       

      I was not able to find a similar problem here on the forum: is it a known problem?

       

      thank you

      carlo

        • 1. Re: ScriptUI CS5
          sotospeak2009 Level 1

          trying to semplify my UI but this is still not working: when you click on the icon, file dialog opens and the panel becomes empty.

           

          #targetengine "mysession"
          #target indesign

          var script_dir = find_script_dir();
          var myicon=script_dir+"/"+"folder-edit.png";
          var w = new Window ("palette", "Test", undefined, {closeButton: false});
          w.alignChildren = "left";
          var tpanel = w.add ("tabbedpanel");
          tpanel.alignChildren = ["fill", "fill"];
          tpanel.preferredSize = [350,300];
          var f = File (myicon);
          var opt = tpanel.add ("tab", undefined, "Esporta Testi");
          opt.alignChildren = "fill";
          var opzioni = opt.add ("panel", undefined, "Opzioni");
          opzioni.alignment=["fill","top"];
          var group1 = opzioni.add ("group");
          group1.alignment=["fill","center"];
          var myicon= group1.add ("iconbutton", undefined, f, {style: "toolbutton"});
          myicon.alignment=["right","center"];
          var buttons = w.add ("group");
          btn_ok=buttons.add ("button", undefined, "Esporta", {name: "ok"});
          btn_cnc=buttons.add ("button", undefined, "Annulla",{name: "cancel"});
          w.show ();

           

          myicon.onClick = function () {
             
          var myfilecsv=File.saveDialog("Scegli nome del file csv");
          myText.text=myfilecsv.fsName;
          myTextFilePath=myfilecsv.fsName;
          myTextFile=File(myTextFilePath);
          return false

           

          }

           

          btn_cnc.onClick=function() {
              w.close();   
              }

          • 2. Re: ScriptUI CS5
            [Jongware]-9BC6tI Level 4

            For what it's worth, I tried your script with CS4, and it works fine! So it seems there is nothing wrong with your code ...

             

            scriptui cs4.PNG

             

            (The icon button flickers quite annoyingly, but that seems to be normal behavior.)

            • 3. Re: ScriptUI CS5
              sotospeak2009 Level 1

              Thank you Jongware but the problem is with CS5 (only Windows seems affected), I know that CS4 is fine:

               

              when you click on the icon and file dialog opens, panel contents disappear (two different windows machine same behaviour).

               

              carlo

              • 4. Re: ScriptUI CS5
                Harbs. Level 6

                You can try win.layout.layout() at the end of the function. I've never seen this problem, but maybe a little wakeup call would help...

                 

                It might also be worth trying dialog instead of palette.


                Harbs

                • 5. Re: ScriptUI CS5
                  sotospeak2009 Level 1

                  Thank you Harbs but no success,

                  added win.layout.layout() at the end of the function, no success. Added tpanel.selection=opt at the end of the function, no success.

                   

                  Regarding "dialog" instead of "palette", if I go with "dialog" I can not open File Save window clicking on the icon.

                   

                  It looks very strange to me no one else had such a problem here on the forum and I can not believe my installation is faulty in two different windows 7 machines (btw, I tried to upgrade ID to 7.03 but the problem persists.)

                   

                  I would be grateful if someone else could execute the code on Windows-CS5 and eventually confirm this.

                   

                  Btw, I do not have osx here, but one of my colleagues said this problem seems not affect Macs.

                  • 6. Re: ScriptUI CS5
                    Harbs. Level 6

                    sotospeak2009 wrote:


                    Regarding "dialog" instead of "palette", if I go with "dialog" I can not open File Save window clicking on the icon.

                     

                    Why not? Have you tried?

                     

                    The File object is part of the ExtendScript DOM -- not the InDesign one...

                     

                    Harbs

                    • 7. Re: ScriptUI CS5 - tabbedpanel bug?
                      sotospeak2009 Level 1

                      Thank you Harbs for your time.

                       

                      If set to Dialog, it is not working: when you click on the icon, Save Dialog window does not open. Actually the same behaviour I have with CS4.

                      Tried to change icon.

                      Tried to bind the Onclick event to a button instead of an icon.

                       

                      I am a bit lost, I do not know what else I could try..

                       

                      If I change the "tabbedpanel" with a simple "panel", then it is ok, I can click on a button/icon, the saveDialog (or the openDialog) opens and my "panel" contents is still there.

                       

                      I tried also the "reverse": left the tabbedpanel as parent, killed the "panel" children and attached icons and buttons directly to the "tab" child. When saveDialog opens, all tabbedpanel contents is lost (in both tabs).

                       

                      I am starting to look at this as a huge bug..hope to get it wrong.

                       

                      carlo

                       

                      Message was edited by: sotospeak2009

                      • 8. Re: ScriptUI CS5
                        Ian Proudfoot Level 3

                        Hi Carlo,

                        This is a known issue with ScriptUI for CS5 on Windows. It was found and fixed for the new ExtendScript engine in FrameMaker10. However its still there for the CS5 applications. The best thing to do is submit a bug report as I don't think there is a usable work-around if you need to use a palette.

                         

                        Ian

                        1 person found this helpful
                        • 9. Re: ScriptUI CS5
                          sotospeak2009 Level 1

                          Hi Ian,

                          thank you for your reply.

                           

                          If you don't mind:

                           

                          1. can you give me a link to report the bug?

                          2. do you think an update/patch to fix that is foreseeable in a near future from Adobe?

                          3. Harb's suggestion and when you say "as I don't think there is a usable work-around if you need to use a palette" made me think. If I want my tabbedpanel open when the save Dialog shows up my only chance is to get a "palette" type window (modeless), am I wrong?

                           

                          thank you

                          carlo

                          • 10. Re: ScriptUI CS5
                            Ian Proudfoot Level 3

                            Carlo,

                             

                            1. I can't speak on behalf of Adobe as I'm not an employee. But I would guess that as it has been fixed for FrameMaker it should be fixed for the CS5 products at some point in the future. The best way to ensure that it is fixed is to submit the bug report.
                            2. There should be no reason why you can't show the file save dialog from a Script UI dialog. It would be a severe limitation on the usability of the interface if it could not be done. In fact I've done that very thing in several places a recent project.

                             

                            Ian

                            • 11. Re: ScriptUI CS5
                              sotospeak2009 Level 1

                              Thanks Ian and Harbs for your helpful support.

                               

                              carlo