Step through all the layers in the comp, check to see if they’re unselected, and create your own array of unselected layers.
This code ought to do it:
function getUnselectedLayers(comp) {
if (comp instanceof CompItem) {
var unselectedLayers = [];
for (var compLayerIndex = 1; compLayerIndex < comp.numLayers; compLayerIndex++) {
if (comp.layer(compLayerIndex).selected == false) unselectedLayers.push(comp.layer(compLayerIndex));
}
return unselectedLayers;
} else {
return null;
}
}
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]