Answered
Script to change the color of the selected texts
Hello Everyone,
I have struck in writting script to changing the color of the selected texts to the spot color. Would anyone can help on this.
I have placed the drafted script as well.
docRef = app.activeDocument;
var selectedObjects = docRef.selection;
var sel = selectedObjects.textFrames;
var color1 = new CMYKColor();
color1.cyan = 100;
color1.magenta = 0;
color1.yellow = 0;
color1.black = 0;
var spot = docRef.spots.add();
spot.color = color1;
spot.colorType = ColorModel.SPOT;
spot.name = "Keyline Blue";
var keyline = docRef.swatches.getByName('Keyline Blue');
for (i=0; i < sel.length; i++)
{
sel[i].textRange.characters.fillColor = keyline.color;
}
