Script to change the color of the selected texts that grouped
Hello Everyone,
I have the script to change the color of the text in the selected text frame.
But, sometimes in my file certain textframes are grouped together, at that time this script doesn't change the color of the text in grouped text frames.
Someone would help to figure out this situation.
I am attaching the code that worked for the non grouped text frames.
docRef = app.activeDocument;
var selectedObjects = docRef.selection;
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";
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].typename == "TextFrame") {
selectedObjects[i].textRange.fillColor = keyline.color;
}
}
