Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

How to call a swatch from the library

$
0
0

Hi,

 

I'm writing a script to create a new AI document with a restricted swatchbook. The designer is supposed to use only the swatches/inks provided by this script.

So far I was able to delete all current swatches and add a CMYK or RGB spotcolor swatch.

 

var inkt02 = app.activeDocument.spots.add();

inkt02.name = 'inkt 2';

inkt02.colorType = ColorModel.SPOT;

var kleur02 = new CMYKColor();

kleur02.black = 10;

kleur02.cyan = 80;

kleur02.magenta = 0;

kleur02.yellow = 90;

inkt02.color = kleur02;

var newSpotColor = new SpotColor();

newSpotColor = inkt02;

newSpotColor.tint = 100;

thePallet.addSpot(newSpotColor);

 

Often we will be dealing with Pantone colors. No need to define these, as they are inside AI already, right? But how to call them from the library?

 

I'm new to ExtendScript, but this forum (and google) helped me along nicely so far :-)  I don't have a concrete use case for this yet, but I decided on this exercise as a good way to learn about ExtendScript.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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