This seems so simple, but I cannot figure this out.
I have selected Stroke and Fill under ShapeLayer. And I want to remove them from this layer.
var myLayer = myComp.selectedLayers[0];
var propertyCollection = myLayer.selectedProperties;
for (var j = propertyCollection.length-1; j >= 0; j --) {
propertyCollection[j].remove()
}
However, on second iteration AE gives me error "Object is invalid". Am I missing something?
P.S. How do I paste code here so it looks like a code, and not a text?