-
Use marker comments to parent layers back to their original parents
Hi I’ve created a script that takes all layers that have a parent layer, then adds a marker to them using their parent layer name name. Then unparents them. I’m trying to create a script that does the reverse in a way;
The script will look through the selected layers, find the marker name that coincides with their original parent layer and then reparents them back.
Here is my current code which is the second part; the part that reconnects it. Please if someone could aid me.
app.beginUndoGroup(“Null_Capture”);
var comp = app.project.activeItem; // active comp
if (comp instanceof CompItem) {
for (i = 1; i <= app.project.activeItem.selectedLayers.length; i++) {
if (comp.layer(i).property(“Marker”).keyValue(1).comment == comp.layer(i).name) {
alert(“test works”);
}
}
}
app.endUndoGroup();