illustrator-scripting-guide icon indicating copy to clipboard operation
illustrator-scripting-guide copied to clipboard

spotColor.tint not working

Open robochris opened this issue 4 months ago • 0 comments

From the documentation (https://ai-scripting.docsforadobe.dev/), if you go to "Javascript Object Reference"->"SpotColor"

It says spotColor.tint but that didn't work for me. I had to do Object.fillColor.tint to get the tint to work properly. Initially I did what the doc says and then did Object.fillColor = spotColor. Debugging shows the tint was set correctly but visually I couldn't see it. So, I found that the Object.fillColor.tint worked best.

Is anyone able to explain what is happening? Am I using it wrong?

function setFill(item, spotName, tintValue) {
  var doc = app.activeDocument;
  var spot;

  try {
    spot = doc.spots.getByName(spotName);
  } catch(e) {
    err("Cannot find spot: " + spotName);
    return;
  }
  item.selected = true;
  var sc = new SpotColor();
  sc.spot = spot;
  item.fillColor = sc;
  item.fillColor.tint = tintValue;
}

robochris avatar Oct 02 '25 20:10 robochris