Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

How do I make a symbol from selection?

$
0
0

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

}


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>