1 Reply Latest reply on Sep 18, 2017 2:27 PM by Silly-V

    ScriptUI: How do I un-highlight a button that was just clicked?

    jsavage77 Level 1

         When a user clicks on a button, it remains highlighted in blue (to show it was the last button clicked). I'd like to be able to un-highlight it in my onClick callback. Does anyone know how to accomplish that?

        • 1. Re: ScriptUI: How do I un-highlight a button that was just clicked?
          Silly-V Adobe Community Professional

          Use

          this.active = true; this.active = false;
          

          in your onClick function:

           

          #target illustrator
          function test(){
          
           var counter = 0;
          
            var w = new Window("dialog");
            var btn1 = w.add("button", undefined, "Test 1");
            var btn2 = w.add("button", undefined, "Test 2");
            var e = w.add("edittext", undefined, "");
            e.characters = 10;
          
            btn1.onClick = function(){
              e.text = "Click Count: " + (counter++);
              this.active = true;
              this.active = false;
            }
            w.show();
          };
          test();