Page 1 of 1

In ecma Scripting How do I check if the layer is empty

Posted: Wed Mar 29, 2017 8:13 am
by kinoy
Is there any method to check if the layer contents are empty through ecma script when the layer is present.

Re: In ecma Scripting How do I check if the layer is empty

Posted: Wed Mar 29, 2017 10:36 am
by andrew

Code: Select all

var ids = doc.queryLayerEntities(layerId, true);
if (ids.length===0) {
    // there are no entities in any blocks on this layer
}