2 Replies Latest reply on Jun 12, 2014 6:47 AM by Ferrarezzi

    CHECK BOX

    Ferrarezzi

      Hello everyone, I'm trying to create a simple window by clicking the check box "select all" all other check box will be selected but do not know which event to use and how to make the window is updated with the check box selected.

       

      Could anyone help me?

       

      The script is this:

       

      # target illustrator

       

      var w = new Window ("dialog");

      check1 w.add var = ("checkbox", undefined, "test1");

      check2 w.add var = ("checkbox", undefined, "test2");

      check3 w.add var = ("checkbox", undefined, "test3");

      check4 w.add var = ("checkbox", undefined, "test4");

      check5 w.add var = ("checkbox", undefined, "select all");

      w.show ();

       

      check2.onClick = function () {

        check1.value = true;

        check2.value = true;

        check3.value = true;

        w.update ();

           }

        • 1. Re: CHECK BOX
          CarlosCanto Adobe Community Professional & MVP

          does your code work at all?

           

          this is no good

          check1 w.add var = ("checkbox", undefined, "test1");


          use this

          var check1 = w.add ("checkbox", undefined, "test1");



          move this line at the bottom, after the onClick function

          w.show ();

          • 2. Re: CHECK BOX
            Ferrarezzi Level 1

            Hi Carlos thank you very much for your help, my test script was well.

             

            #target illustrator

             

            var w = new Window ("dialog");

            var check1 = w.add ("checkbox", undefined, "test1");

            var check2 = w.add ("checkbox", undefined, "test2");

            var check3 = w.add ("checkbox", undefined, "test3");

            var check4 = w.add ("checkbox", undefined, "test4");

            var check5 = w.add ("checkbox", undefined, "select all");

             

            check5.onClick = function () {

               

                if (check5.value == true){

                check1.value = true;

                check2.value = true;

                check3.value = true;

                check4.value = true;

              }

             

            else {

                check1.value = false;

                check2.value = false;

                check3.value = false;

                check4.value = false;

                }

             

             

                 }

             

            w.show ();