Im sorry it took so long to respond. I finally had a chance to try this, but I get the error
"Unable to execute script at line 8. undefined is not an object"
Line 8 is:
if (thislayer.selected) selectedLayers.push(i);
I have the comp selected. I have nothing but the shape layers im wanting to pre-compose in the comp, and I have them all highlighted/selected before running the script.
Since it's a script and not an expression, I don't think I have to define an index number/range, so im at a bit of a loss on whats goin' on here.
Sorry, missed a line when I pasted:
var moveAllAttributes = true;
var laycol = app.project.activeItem.layers;
// first cache the array of layer selections, starting at the bottom
var selectedLayers = new Array();
for (var i=laycol.length; i>0; i--) {
var thislayer = laycol;
if (thislayer.selected) selectedLayers.push(i);
}
// now precompose them individually
for (var s=0; s<selectedLayers.length; s++) {
var thislayer = laycol[selectedLayers];
var precomp_name = thislayer.name;
laycol.precompose([selectedLayers],precomp_name,moveAllAttributes);
}