1 Reply Latest reply on Feb 6, 2016 3:35 PM by arteangelus

    Cannot get variable values from Panel

    arteangelus Level 1

      Hello trying to learn scripting;


      Cannot read variables from panel; It only reads first variable default definition.What am I doing wrong?

      Here I would like to read wvalue and hvalue but in main function It still shows the first wvalue/hvalue'..It does not update as user changes them.


      #target photoshop
      var wvalue =1;
      var hvalue =1;
      var docRef = app.activeDocument;
          var dlg = new Window('dialog', 'Test',[100,100,380,280]);
          dlg.mspanel = dlg.add('panel', [25,15,250,150], 'Test Panel');
          dlg.mspanel.widthtext = dlg.mspanel.add('statictext', [15,17,50,37], 'Width:', {name:'widthtext'});
          dlg.mspanel.widthdivision = dlg.mspanel.add('edittext', [60,15,90,35],wvalue, {name:'widthdivision'});
          dlg.mspanel.heighttext = dlg.mspanel.add('statictext', [100,17,140,37], 'Height:', {name:'heighttext'});
          dlg.mspanel.heightdivision = dlg.mspanel.add('edittext', [150,15,180,35],hvalue, {name:'hdiv'});
          dlg.mspanel.okbtn = dlg.mspanel.add('button', [15,50,180,75], 'Ok', {name:'ok'});
          dlg.mspanel.cancelbtn= dlg.mspanel.add('button', [15,85,180,110], 'Cancel', {name:'cancel'});
          dlg.mspanel.okbtn.onClick = main;
          function main() {