Copy link to clipboard
Copied
Hey all,
I have a compositions named from P1 to P10 (I'll call them "Parent" compositions) consisting of shape "RandShape" and composition named "C" + number according to the composition in which it is located (I'll call them "Child" compositions). Compositions "Child" consisting of shape "ParShape". I need to change ParShape's color to RandShape's color. RandShape's color generates randomly.
Any ideas how to do it with script?
I did it!
var child = app.project.item(1);
var parent = app.project.item(12);
for(i = 1; i <= placeholder.numItems; i++){
compId = comps.item(i);
var rgbValue = compId.layer("RandShape").content("Ellipse 5").content("Fill 1").color.value;
child.item(i).layer("ParShape").content("Rectangle 1").content("Fill 1").color.setValue(rgbValue);
}
Copy link to clipboard
Copied
I did it!
var child = app.project.item(1);
var parent = app.project.item(12);
for(i = 1; i <= placeholder.numItems; i++){
compId = comps.item(i);
var rgbValue = compId.layer("RandShape").content("Ellipse 5").content("Fill 1").color.value;
child.item(i).layer("ParShape").content("Rectangle 1").content("Fill 1").color.setValue(rgbValue);
}