8 Replies Latest reply on Jan 18, 2016 8:27 PM by tpk1982

    Dialog VS Palette (Palette not support)

    BEGINNER_X Level 3

      Hi All,

       

      While using       "var w = new Window ("dialog")", working & display like a charm

       

      If I am using,     "var w = new Window ("palette"); UI comes and hide

       

      Tried Indesign version CS6 & CC2014.

       

      Below is the DIALOG coding, working like a charm.

      Suppose, If change dialog into palette, UI not working properly.

       

      Please help.

       

       

      var myDoc = app.activeDocument;
      var myDocFullPath = app.activeDocument.fullName;
      myDocFullPath = myDocFullPath + "";
      
      
      //-------------------------------------START UI1--------------------------------------
          var myCount_UI = 0;
          var clickcancel = 0;
          
          var w = new Window ("dialog");
          var myGroup1 = w.add('panel', undefined, 'RRRRR');
          myGroup1.alignChildren = "left";
          
      
      
          var versions = ["--", "V1", "V2", "V3", "V4", "V5"];
          var main = myGroup1.add ('panel {orientation: "row"}');
          var group = main.add ("group {alignChildren: 'left', orientation: 'row'}");
          group.add ("statictext", undefined, "Job Version*         : ");
          var list5 = group.add ("dropdownlist", [0,0,100,20], versions);
          list5.minimumSize.width = 250;
          list5.selection = 0;
      
      
      
      
           var Oper_Name = ["--",         "XXX", "YYY"];
      
      
          var group = main.add ("group {alignChildren: 'left', orientation: 'row'}");
          group.add ("statictext", undefined, "Operator Name*    : ");
          var list4 = group.add ("dropdownlist", [0,0,250,20], Oper_Name);
          list4.minimumSize.width = 250;
          list4.selection = 0;
          
          //Button Concept Here
          var myButtons = w.add ("group");
          var EXPORT = myButtons.add("button", undefined, "GoTo CheckList", {name: "ok"});
          var CAN = myButtons.add("button", undefined, "Cancel", {name: "exit"});
              
           EXPORT.onClick = function () {
              if(list5.selection.index == 0) {
               alert("PLEASE SELECT INDESIGN VERSIONS ");
              }
              else{
                      w.close();
                  }
          }
      
      
          CAN.onClick = function (){
                  clickcancel = 1;
                  w.close();
              }
          
          w.show();
      
      
          if(clickcancel == 1){
                  //this.exit();
                 exit();
                 }
             
      //---------------------------------------------END OF UI1-----------------------------------
      
      
      
      
      //---------------------------------------------START OF UI2-----------------------------------
      
      
      
      
      if(myDocFullPath.indexOf("/PROCTER_AND_GAMBLE/") >= 0)
      {
          var myRegion = "AAA";
      
      
                 var w = new Window ("dialog");
                  w.alignChildren = "left";
                  var myGroup1 = w.add('panel', undefined, 'TTTTTT');
                  myGroup1.alignChildren = "left";
                  var checkbox1 = myGroup1.add ("checkbox", undefined, "01.  Check the ratio, artwork & live area sizes against job ticket and slug information");
                  var checkbox2 = myGroup1.add ("checkbox", undefined, "02.  Check images are linked");
      
      
                  
                  var myButtons = w.add ("group");
                  var EXPORT = myButtons.add("button", undefined, "Export PDF", {name: "ok"});
                  var CAN = myButtons.add("button", undefined, "Cancel", {name: "exit"});
                  
                   EXPORT.onClick = function () {
                       w.close(); }
      
      
              CAN.onClick = function (){
                      clickcancel = 1;
                      w.close();}
              
          w.show();
      
      
                  if(clickcancel == 1)
                  {
                          //this.exit();
                         exit();
                      }      
      
      
      }
      
        • 1. Re: Dialog VS Palette (Palette not support)
          tpk1982 Level 4

          Hi Siraj,

           

          A dialog window does wait for show() to complete. A palette window does not wait for show() to complete.


          Add "#targetengine "session" at the beginning of your script ...

          or

          Use $.sleep()

           

          Thanks,

          Karthi

          • 2. Re: Dialog VS Palette (Palette not support)
            BEGINNER_X Level 3

            Hi,


            I tried "#targetengine "session"" in the beginning of script, even though not working.


            See the above script, in my code two UI is using.

             

            Thanks in advance

            Siraj

            • 3. Re: Dialog VS Palette (Palette not support)
              tpk1982 Level 4

              Really?? Here its working fine..

               

              okay

               

              Use $.sleep() then


              • 4. Re: Dialog VS Palette (Palette not support)
                tpk1982 Level 4

                change both in line 10 and 79 to "palette"

                • 5. Re: Dialog VS Palette (Palette not support)
                  BEGINNER_X Level 3

                  Any help, Still not working...

                   

                  If anyone test in your end,

                  1. copy and Paste the provided script (dialog) and run the script ------ Two UI will Shown

                  2. Replace Dialog into Palette (2 occurrences) and run the script ---- One UI will shown

                   

                  Any clarification, please test and revert.

                  • 6. Re: Dialog VS Palette (Palette not support)
                    tpk1982 Level 4

                    even with "dialog".. no 2 UI shown!!!

                     

                    we need to have /PROCTER_AND_GAMBLE/ folder? be specfic

                    • 7. Re: Dialog VS Palette (Palette not support)
                      BEGINNER_X Level 3

                      Hi All,

                       

                      Please help to solve this bug or issues.


                      Karthi: Place Indesign File inside the "PROCTER_AND_GAMBLE" Folder.

                      • 8. Re: Dialog VS Palette (Palette not support)
                        tpk1982 Level 4

                        Hi SIraj,

                         

                        I just add those 2 UI as functions and it is working fine.. pls use the below code:

                         

                        #targetengine "siraj"
                        var myDoc = app.activeDocument; 
                        var myDocFullPath = app.activeDocument.fullName; 
                        myDocFullPath = myDocFullPath + ""; 
                        myui1();
                        
                        
                        
                        
                        function myui1()
                        {
                        //-------------------------------------START UI1-------------------------------------- 
                            var myCount_UI = 0; 
                            var clickcancel = 0; 
                             
                            var w = new Window ("palette"); 
                            var myGroup1 = w.add('panel', undefined, 'RRRRR'); 
                            myGroup1.alignChildren = "left"; 
                             
                        
                        
                            var versions = ["--", "V1", "V2", "V3", "V4", "V5"]; 
                            var main = myGroup1.add ('panel {orientation: "row"}'); 
                            var group = main.add ("group {alignChildren: 'left', orientation: 'row'}"); 
                            group.add ("statictext", undefined, "Job Version*        : "); 
                            var list5 = group.add ("dropdownlist", [0,0,100,20], versions); 
                            list5.minimumSize.width = 250; 
                            list5.selection = 0; 
                        
                        
                        
                        
                            var Oper_Name = ["--",        "XXX", "YYY"]; 
                        
                        
                            var group = main.add ("group {alignChildren: 'left', orientation: 'row'}"); 
                            group.add ("statictext", undefined, "Operator Name*    : "); 
                            var list4 = group.add ("dropdownlist", [0,0,250,20], Oper_Name); 
                            list4.minimumSize.width = 250; 
                            list4.selection = 0; 
                             
                            //Button Concept Here 
                            var myButtons = w.add ("group"); 
                            var EXPORT = myButtons.add("button", undefined, "GoTo CheckList", {name: "ok"}); 
                            var CAN = myButtons.add("button", undefined, "Cancel", {name: "exit"}); 
                                 
                            EXPORT.onClick = function () { 
                               
                                if(list5.selection.index == 0) { 
                                alert("PLEASE SELECT INDESIGN VERSIONS "); 
                               
                                } 
                                else{ 
                                        w.close(); 
                                    } 
                                myui2();
                            } 
                        
                        
                            CAN.onClick = function (){ 
                                    clickcancel = 1; 
                                    w.close(); 
                                   
                                } 
                             
                            w.show(); 
                        
                        
                            if(clickcancel == 1){ 
                                    //this.exit(); 
                                  exit(); 
                                  } 
                             
                        
                        
                                }
                        //---------------------------------------------END OF UI1----------------------------------- 
                        
                        
                        
                        
                        //---------------------------------------------START OF UI2----------------------------------- 
                        
                        
                          function myui2()
                        {
                        
                        if(myDocFullPath.indexOf("/PROCTER_AND_GAMBLE/") >= 0) 
                        { 
                            var myRegion = "AAA"; 
                        
                        
                                  var w = new Window ("palette"); 
                                    w.alignChildren = "left"; 
                                    var myGroup1 = w.add('panel', undefined, 'TTTTTT'); 
                                    myGroup1.alignChildren = "left"; 
                                    var checkbox1 = myGroup1.add ("checkbox", undefined, "01.  Check the ratio, artwork & live area sizes against job ticket and slug information"); 
                                    var checkbox2 = myGroup1.add ("checkbox", undefined, "02.  Check images are linked"); 
                        
                        
                                     
                                    var myButtons = w.add ("group"); 
                                    var EXPORT = myButtons.add("button", undefined, "Export PDF", {name: "ok"}); 
                                    var CAN = myButtons.add("button", undefined, "Cancel", {name: "exit"}); 
                                     
                                    EXPORT.onClick = function () { 
                                        w.close(); } 
                        
                        
                                CAN.onClick = function (){ 
                                        clickcancel = 1; 
                                        w.close();} 
                                 
                            w.show(); 
                        
                        
                                    if(clickcancel == 1) 
                                    { 
                                            //this.exit(); 
                                          exit(); 
                                        }       
                        
                        
                        }  }