Skip to main content
Participant
March 27, 2008
Question

Delete swatches

  • March 27, 2008
  • 2 replies
  • 589 views
Hi,

I'm making a script that deletes all the swatches in a document.
That seems very simple using the following line:

> myDoc.swatches.removeAll();

However, for some objects that still use a swatch as fill color, the fill color is replaced by black. I want the object to stay exactly the same...
If I delete all swatches using the interface, it's behaving like I want it to, the swatches are removed, and the color/gradients are preserved.

Any ideas how to replicate this behavior using a script?

I'm using JavaScript, but an AppleScript solution would also be of great help for me.
This topic has been closed for replies.

2 replies

Participant
March 29, 2008
Thanks! I had thought about this approach, but I forgot the toggle dialog option...
Participating Frequently
March 29, 2008
make action:
-select all unused
-delete swatch (toggle dialog off)
and execute it via script.