Copy link to clipboard
Copied
Hi everyone!
I have a couple of Nulls inside Comp 2 and this comp is a precomp inside Comp 1.
I need to create a script that checks if there is an effect in the selected Null then add the same effect to Comp 2. This is only for Checkboxes and Sliders, nothing major.
I think one of the reasons this is not working is because I'm using the activeItem. The script needs to look for a specific comp name because my projects have many layers and sorting by items indexes might not always work.
I feel that adding the expressions to link both parameters later would be very simple once I understand how the heck to access Comp 2 from within it.
This is what I have so far:
var myComp;
for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'Comp 2')) {
myComp = app.project.item(i);
break;
}
}
var baseComp = myComp.layer("Comp 2");
var baseCompSlider = baseComp.effect.addProperty("ADBE Slider Control");
alert (myComp.name + selectedLayer.name);
I know I'm kinda crazy and perhaps the idea is redundant, but please help this crazy guy solve this rittle. I'm learning to code.
Thank you.
Have something to add?