I've got the below script, but it's not working. I'm trying to select all the art in the document on different layers, and create a symbol. So far I have the first part down, but can't figure out how to reference what is selected. actDoc.selection comes out as undefined. I've also tried to use "actDoc.PageItem.selected = true" and a few other variants, but I'm coming up empty. Anyone have recommendations for this?
actDoc = app.activeDocument
var layerCount = actDoc.layers.length;
if(layerCount > 1) {
for(i=0;i<layerCount;i++) {
actDoc.layers[i].hasSelectedArtwork = true // selects all layers
}
actDoc.symbols.add(actDoc.selection); // <---------- Here's where the error is thrown
}