Illustrator: delete all swatches except for gradients and patterns

Is there a way to delete only color swatches while excluding pattern and gradient swatches? For example this code snippet does not work:

tell application "Adobe Illustrator"
	activate
	delete (every swatch of current document whose class of color is not pattern color info and every swatch of current document whose class of color is not gradient color info)
end tell

Why do I get the feeling my syntax is wrong :frowning:

Thanks in advance,
Jeff

Try this:


	delete (every swatch of document 1 whose (class of color is not gradient color info) and (class of color is not pattern color info))

Yep, that’s it! Thank you very much Jerome (once again) :slight_smile:

No problem Jeff, those parens can make or break you can’t they?

LOL, you got that right!