Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 66447

Re: Spot Color conflict Placed PDF

$
0
0

here, give this a go.

 

this is a run once per document function.

 

it does not care if the swatch existed in the document etc..

any item in the document that was using one of these swatches will keep that association. even if this script has to move it into one of the preset groups.

 

function AddMySwatches(doc){    function createSwatch(g,n,c,m,y,k){        var group, sw;        try{            group = doc.swatchGroups.getByName(g);        }catch(e){            group = doc.swatchGroups.add();            group.name = g;        }        try{            sw = doc.spots.getByName(n);        }catch(e){            sw = doc.spots.add();            sw.colorType = ColorModel.SPOT;            sw.name = n;            sw.color.cyan = c;            sw.color.magenta = m;            sw.color.yellow = y;            sw.color.black = k;        }        sw = doc.spots.getByName(n);        group.addSpot(sw);    }    createSwatch('Primary','Primary_Blue',88,53,0,0);    createSwatch('Primary','Primary_yellow',4,0,90,0);    createSwatch('Primary','Primary_Red',0,99,97,0);    createSwatch('Primary','Primary_Cyan',70,15,0,0);    createSwatch('Secondary','Secondary_Orange',0,50,100,0);    createSwatch('Secondary','Secondary_Green',50,0,100,0);    createSwatch('Secondary','Secondary_Purple',60,60,0,0);    createSwatch('Tertiary','Tertiary_Pink',0,96,3,0);    createSwatch('Tertiary','Tertiary_Black',75,68,67,90);
}
var doc = app.activeDocument;
AddMySwatches(doc);


//example use
doc.selection[0].fillColor = doc.swatches.getByName('Tertiary_Black').color;



Viewing all articles
Browse latest Browse all 66447

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>