on IdentifyEmptyLayers(myDoc)
tell application "Adobe Illustrator"
set myLayerNumbers to the number of every layer of myDoc
set myEmptyLayerNumbers to {}
repeat with myLayerIndex from 1 to myLayerNumbers
-- get the number of page items in each layer
set errorOccurred to false
set myTaskMsg to "get the number of page items in layer " & myLayerIndex & ""
set myFailureMsg to "could not " & myTaskMsg
try
set myPageItems to count every page item in layer myLayerIndex of myDoc
on error errMsg number errNum
set errorOccurred to true
end try
tell me to UpdateActivityStatus(myTaskMsg, errorOccurred, "bail", myFailureMsg)
if myPageItems = 0 then
set the end of myEmptyLayerNumbers to myLayerIndex
set myLayerName to the name of layer myLayerIndex of myDoc
display dialog myLayerName
end if
end repeat
end tell
return myEmptyLayerNumbers
end IdentifyEmptyLayers
Cheers.