Skip to main content
Participant
February 13, 2014
Question

Removing Empty Layers

  • February 13, 2014
  • 2 replies
  • 1509 views

I am looking for a script that will look through all the layers in my file and if there are no objects on the layer I would like it to delete them.

I know how to remove a layer with a script, just not how to identify a layer or many layers that may no have objects on them.

Thanks

Andy

This topic has been closed for replies.

2 replies

Inspiring
February 13, 2014

Did you try searching?

By way of a simple Google Search of: illustrator script delete empty layers

The very first link retruned from Google:

https://github.com/nvkelso/illustrator-scripts/blob/master/layers/DeleteEmptyLayers.jsx

Hope it is helpful for your efforts. ;-)

aoswoodAuthor
Participant
February 13, 2014

Ok I feel really dumb now. Yes that was exactly what I was looking for. I searched through the forum here but never bothered to check with my friend Google.

Thanks for the link.

Inspiring
February 13, 2014

You're welcome, I think a reference(s) to that script is even referenced on the forum. No need to feel dumb however. Google is your friend, until they are your enemy of course. ;-)

Larry G. Schneider
Community Expert
Community Expert
February 13, 2014

pageItems is listed as a property of a Layer and if it is <1 you could assume there are no items on that Layer.