Copy link to clipboard
Copied
Hi everyone. I'm hitting a bit of a wall when trying to add a simple Checkbox contgrol to a comp the same way I would to a regular Null.
var myComp = app.project.activeItem;
var myNull = myComp.layers.addNull();
myNull.name = "Controller";
var nullOnOffControl = myNull.effect.addProperty("ADBE Checkbox Control");
var compOnOffControl = myComp.effect.addProperty("ADBE Checkbox Control");
Thanks!
Copy link to clipboard
Copied
I don't understand exactly what you're trying to do, but comps don't have effects, so you can't add a checkbox to one. You could add an effect to a comp as a layer in another comp, but it doens't appear that that's what you're trying to do.
Copy link to clipboard
Copied
Hey Dan, Thanks for your reply, please bare with me.
It seems like there is no way to add an effect to a Comp item the same way you add it to a Null or a Layer throught scripting (as I showed in my script). What I find odd is that in After Effects you CAN actually do this manually by creating a precomp within an comp and right click + add an effect to the pre-comp.
Maybe I'm not explaining myself right, but I'm trying to add effects to a comp within a comp and I'm still not able to do that. I'm not sure what I'm missing here.
Copy link to clipboard
Copied
You'd have to address the precomp as a layer within the comp, like this:
var myComp = app.project.activeItem;
var myPrecomp = myComp.layer("myPrecomp");
var compOnOffControl = myPrecomp.effect.addProperty("ADBE Checkbox Control");
Copy link to clipboard
Copied
Gotcha! thank you.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more