I am trying to get Illustrator to recognise different variations of a certain color, and then delete any elements which are not made up of that color.
I have tried many things, and have come close. This is the script shown below.
the error i get is "cannot get every group item of layer 1 of document 1 whose swatch spot color into ≠“Color|color|COLOR”.
tell application "Illustrator CS"
set mydoc to document 1
activate
tell mydoc
try
swatch "Cutter" = true
set value_1 to "Color"
on error
try
swatch "cutter" = true
set value_1 to "color"
on error
try
swatch "CUTTER" = true
set value_1 to "COLOR"
on error
try
swatch "Cutter|cutter|CUTTER" = true
set value_1 to "Color|color|COLOR"
on error
display dialog "No Color Found
Now Halting Script" buttons {"OK"} default button {"OK"}
stop
end try
end try
end try
end try
end tell
--tell application "Illustrator CS"
tell (every group item of layer 1 of mydoc where swatch spot color info is value_1)
delete (every group item of layer 1 of mydoc where swatch spot color info is not value_1)
end tell
tell (every path item of layer 1 of mydoc where swatch spot color info is not value_1)
delete every path item of layer 1 of mydoc
end tell
end tell
Any help with this is greatly apprecited.