The below script is excellent (and not mine), yet I believe there is one issue in regards to clipping masks. The script removes all non painted objects from an Illustrator CS document. But since a clipping mask is set to a non painted object, the script will remove those as well.
Is is possible to add a parameter that only deletes “non-grouped” and unpainted objects? That should solve that minor issue.
Thanks,
jeff
tell application "Illustrator CS" to activate
deleteUnpainted(1)
on deleteUnpainted(doc)
tell application "Illustrator CS"
if class of doc is integer or class of doc is string then set doc to document doc
tell doc
try
set unpainted to (every path item whose filled is false and class of stroke color is no color info)
delete unpainted
end try
end tell
end tell
end deleteUnpainted