Hi Tomas,
thank you very much for your reply! ☺
I’m sorry if I wasn’t clear enough. So by “layers” I mean: solids, nulls, compositions in the active composition.
I don’t understand what you said:
“What it would do is make copies of selected layers in the first place” – Why? It could link “selection 1” with “selection 2”
If there are 10 solids in my composition. First I select the first 5 solids, then I select another 5 and link the first 5 to second 5. By “link” I mean make parent-child connection.
I found this script here on the forum, and it’s doing the same thing but in a different way.
Thanks for the help 🙂
//Parent
var myComp = app.project.activeItem;
var SecondGrp = myComp.selectedLayers[myComp.selectedLayers.length-1].index+1;
for (var i = 0; i < myComp.selectedLayers.length; i++) {
myComp.selectedLayers[i].parent = myComp.layers [SecondGrp+i];
}
// Invert
var comp = app.project.activeItem;
for (var w = 1; w <= comp.numLayers; w++) {
comp.layers[w].selected = !comp.layers[w].selected;
}