-
Change checkbox True/False with a button (if/else?)
Hi guys, i’m trying to create a button that when you click it a checkbox would change it’s state, if its “false” then it will change to “true”, and if it’s “true” then it will change to “false”. I got it working but the problem is that only works once, then no longer changes, i want it to change everytime i press the button, what am i doing wrong?
This is the code:
myButton.onClick = function(){
app.beginUndoGroup("myScript");
var myLayers = comp.selectedLayers;
for (var i = 0; i < myLayers.length; i++){
myLayers[i].effect("APC Colorama").property(12).setValue(false)
? myLayers[i].effect("APC Colorama").property(12).setValue(false)
: myLayers[i].effect("APC Colorama").property(12).setValue(true);
}
app.endUndoGroup();
}