2 Replies Latest reply on Jul 16, 2014 4:07 PM by creativejoan0425

    Script UI dialog

    creativejoan0425 Level 1

      I have a dialog have 2 button, when I click button 2 can't response the action "print", why?

      below is my Script


             var w1 = new Window ('dialog', 'Test', undefined, {resizeable: true});

             var myText = w1.add('edittext', undefined, 'TEST', {multiline: true});

                  myText.alignment = ['fill', 'fill']

                  myText.minimumSize = [300, 30]

                  w1.location = [55, 140]

             var myButton1 = w1.add('button', undefined, 'Button 1')

              var w2 = new Window ('dialog');

              var panel1 = w2.add ('panel');

              var panel2 = w2.add ('Group');

              var myButton2 = panel2.add('button', undefined, 'myButton2');

                                       panel2.alignChildren ='right';

      myButton1.onClick = function() {

          w2.show();

          }

      myButton2.onClick = function() {

          app.activeDocument.print();

         }

       

       

      w1.show();