6 Replies Latest reply on Apr 19, 2018 10:40 AM by r-bin

    Script errors (CC 2018)

    black_square Level 1

      Hi,

       

      I wrote some years ago a javascript, which worked fine up to PS CC 2014. Recently I tried to run it in PS CC 2018 and it failed. The script creates a  window with various panels containing various buttons and checkboxes. In CC 2018 only the main window and the panels show up, but not the elements within the panels. Code like

       

      win.pnl01.selFolderButton = win.add("button",[320, 140, 420, 160] , "SELECT");

       

      is obviously ignored.

       

      Any suggestions?

       

      Thanks.

        • 1. Re: Script errors (CC 2018)
          Chuck Uebele Adobe Community Professional & MVP

          That line looks fine, so it's hard to tell without seeing more of the code.

          • 2. Re: Script errors (CC 2018)
            black_square Level 1

            app.preferences.rulerUnits = Units.CM;

             

            var win = new Window("dialog", "GUINEA PIG", [150, 150, 600, 900]);

            win.pnl01 = win.add("panel", [10,10,440,180], 'Select a folder');

            win.pnl01.selFolderButton = win.add("button", [320, 140, 420, 160] , "Select");

            win.pnl01.selFolderToCheckTxt = win.add("statictext",[30,50,430,90], "None yet selected");

             

            win.show ();

             

            I broke the code up and wrote this basic script, saved and ran it. This is the result:Bildschirmfoto 2018-04-19 um 17.19.43.png

            • 3. Re: Script errors (CC 2018)
              Chuck Uebele Adobe Community Professional & MVP

              You're adding the buttons to the main win. You need to specify that you're adding them to the panel in the add comment

               

              win.pnl01.selFolderButton = win.pnl01.add("button", [320, 140, 420, 160] , "Select");

              • 4. Re: Script errors (CC 2018)
                black_square Level 1

                Problem solved, thank you. Has this changed? The code worked before CC 2018, I just copied it for the posted GUINEA PIG.

                I had to fix the coordinates as well, since the values now are relative to the panel.

                • 5. Re: Script errors (CC 2018)
                  Chuck Uebele Adobe Community Professional & MVP

                  I don't think it changed. AFAIK, you always had to state the exact panel or group in which a control is to be placed.

                  • 6. Re: Script errors (CC 2018)
                    r-bin Level 5

                    This works in CS6 but not in CC2018

                     

                    var win = new Window("dialog", "GUINEA PIG", [150, 150, 600, 900]);
                    win.add("panel", [10,10,440,180], 'Select a folder');
                    win.add("button", [320, 140, 420, 160] , "Select");
                    win.add("statictext",[30,50,430,90], "None yet selected");
                    win.show ();
                    

                     

                    This works in CC2018 but not in CS6

                     

                    var win = new Window("dialog", "GUINEA PIG", [150, 150, 600, 900]);
                    win.add("button", [320, 140, 420, 160] , "Select");
                    win.add("statictext",[30,50,430,90], "None yet selected");
                    win.add("panel", [10,10,440,180], 'Select a folder');
                    win.show ();
                    

                     

                    Changed the order of drawing. Therefore, the panel overlaps the rest of the elements.