I would like to change the colour of some text.
The problem is if the colour exists I keep getting the error:
8707 the name is in use... -> thisSpot.name = 'SpotRed';
in my script i've tried to watch for it existing with "isValid"?
var myColor = new CMYKColor;
myColor.cyan = 0;
myColor.magenta = 100;
myColor.yellow = 60;
myColor.black = 0;
var thisSpot = docRef.spots.add();
if(docRef.swatches.getByName('SpotRed').isValid != false){
thisSpot.name = 'SpotRed';
thisSpot.color = myColor
thisSpot.colorType = ColorModel.SPOT;
}else{
var mySpot = docRef.swatches.getByName('SpotRed');
docRef.textFrames[0].textRange.fillColor = mySpot.color;
redraw();
}