Question
extendscript checkbox issue firing my code
i have issue with my checkbox code firing part of my code take a look.
if you test it by clicking button on selected solid layer it will add element effect to it.
how ever am trying to use checkbox to enable option in element 3d.
fx.property("VIDEOCOPILOT 3DArray-1202").setValue(1);//Enable Fogif i turn it on in checkbox one after effects freezez why
var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.orientation = "column";
dialog.alignChildren = ["center","top"];
dialog.spacing = 10;
dialog.margins = 16;
var checkbox1 = dialog.add("checkbox", undefined, undefined, {name: "checkbox1"});
checkbox1.text = "Enable Fog";
var checkbox2 = dialog.add("checkbox", undefined, undefined, {name: "checkbox2"});
checkbox2.text = "Checkbox";
var checkbox3 = dialog.add("checkbox", undefined, undefined, {name: "checkbox3"});
checkbox3.text = "Checkbox";
var checkbox4 = dialog.add("checkbox", undefined, undefined, {name: "checkbox4"});
checkbox4.text = "Checkbox";
var checkbox5 = dialog.add("checkbox", undefined, undefined, {name: "checkbox5"});
checkbox5.text = "Checkbox";
var button1 = dialog.add("button", undefined, undefined, {name: "button1"});
button1.text = "Button";
button1.onClick = function () {
function setFx(lyr)
{
var eg = lyr.property("ADBE Effect Parade");
var fx = eg.addProperty("VIDEOCOPILOT 3DArray");
fx.name = "Element"
fx.enabled = true;
// Element/Scene Settings This property cannot be Scripted!
}
if (checkbox1.value == true) {
// alert ("checkbox1");
// fx.property("VIDEOCOPILOT 3DArray-1202").setValue(1);//Enable Fog
}else if (checkbox2.value == true) {
alert ("checkbox2");
}else if (checkbox3.value == true) {
alert ("checkbox3");
}else if (checkbox4.value == true) {
alert ("checkbox4");
}else if (checkbox5.value == true) {
alert ("checkbox5");
} else {
// alert ("na");
}
if ( app.project.activeItem instanceof CompItem) {
var sl = app.project.activeItem.selectedLayers;
if ( sl.length>0){
setFx(sl[0]);
}
}
}
dialog.show();
