AppleScript. Illusrator - Delete All Unused?

I can’t find in the dictionary how to find this for items like Swatches, Graphic Styles, and Symbols how would I go about this? it doesn’t seem to be a property but very straight forward to do in the app.

There is alread a built in action in Illustrator to remove these items in the “Default Actions” pallet. You simply need to call upon it:


tell application "Illustrator CS"
do script "Delete Unused Palette Items" from "Default Actions"
end tell

Thanks had forgot about that action. Was told the same on another forum. Strange but I have to play this acion twice in the app to successfully remove all the items and like wise in the script but it works so thanks anyhow.

I get an this error 'The object “Play action” is not currently available." whenever I try to us this script. Any one have any ideas why?

Model: Mac Pro Mid 2010
AppleScript: 2.6.1
Browser: Google Chrome
Operating System: Other

It should be:


tell application "Illustrator"
do script "Delete Unused Panel Items" from set "Default Actions"
end tell

He accidentally wrote “…Palette Items”