Skip to content

spotColor.tint not working #16

@robochris

Description

@robochris

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions