Friday, July 21, 2017

#1 2017-07-17 04:11:27 am

CWilcke
Member
Registered: 2012-06-14
Posts: 3

Change Spot Color / Remove Spot COlor objects in Adobe Illustrator

Hi,

I want to remove a certain object with a specific spot color from my document. Is it possible to select it by script?

Select by Spot Color? Convert certain spot color to CMYK Color? Remove objects with a certain spot color?

Should be a batch if possible.

Thanks!

Christoph

Offline

 

#2 2017-07-18 03:52:20 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 194

Re: Change Spot Color / Remove Spot COlor objects in Adobe Illustrator

Here's a script to find all page items containing a certain spot color (by name) as the fill, the stroke, or the colorant - which I think are the only options for it's use.

Applescript:

tell application "/Applications/Adobe Illustrator CS6/Adobe Illustrator.app"
   tell the current document
       set desiredSpot to "Liquid Gold"
       set allItems to every page item
       set spotItems to {}
       repeat with i from 1 to count of allItems
           set anItem to item i of allItems
           set {spotFill, spotStroke, spotRaster} to {"", "", ""}
           try
               set spotFill to the name of the spot of the fill color of anItem
           end try
           try
               set spotStroke to the name of the spot of the stroke color of anItem
           end try
           try
               set spotRaster to item 1 of the colorants of anItem
           end try
           if (spotFill is desiredSpot) or (spotStroke is desiredSpot) or (spotRaster is desiredSpot) then copy anItem to the end of spotItems
       end repeat
   end tell
end tell

This removes the objects containing the spot color:

Applescript:

tell application "/Applications/Adobe Illustrator CS6/Adobe Illustrator.app"
   tell the current document
       set desiredSpot to "Liquid Gold"
       set allItems to every page item
       set spotItems to {}
       repeat with i from 1 to count of allItems
           set anItem to item i of allItems
           set {spotFill, spotStroke, spotRaster} to {"", "", ""}
           try
               set spotFill to the name of the spot of the fill color of anItem
           end try
           try
               set spotStroke to the name of the spot of the stroke color of anItem
           end try
           try
               set spotRaster to item 1 of the colorants of anItem
           end try
           if (spotFill is desiredSpot) or (spotStroke is desiredSpot) or (spotRaster is desiredSpot) then copy anItem to the end of spotItems
       end repeat
       
       repeat with i from (count of spotItems) to 1 by -1
           delete item i of spotItems
       end repeat
   end tell
end tell

This converts all the items containing a spot to CMYK, by converting the document swatch:

Applescript:

tell application "/Applications/Adobe Illustrator CS6/Adobe Illustrator.app"
   tell the current document
       set theSpot to spot "Liquid Gold"
       set the color type of theSpot to process color
   end tell
end tell


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)