Reset button state in ScriptUI

When you press the button again, the blue highlight remains
button.onClick = function () {
// do something..
button.active = !button.active;
}

Solution

var btns = dialog.add('group'); 
// ...
for (var i = 0; i < btns.children.length; i++) {
btns.children[i].onClick = function () {
// do something..
// Reset button highlight
var temp = dialog.add('checkbox', undefined, 'checkbox');
temp.active = true;
dialog.update();
temp.remove();
dialog.update();
}
}
Blue highlight fixed, and the user will not see the temporary checkbox

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store