Skip to main content
Inspiring
October 18, 2018
Answered

Script or action to activate global in SwatchColor

  • October 18, 2018
  • 3 replies
  • 776 views

Hello,

I try to modify "global" property of a SwatchColor with script or action but nothing works.

Anyone have an idea ?

Thanks

This topic has been closed for replies.
Correct answer kopaacabana

Sorry,

In fact I found the solution.

I need to create a SpotColor and define properties :

- 'colorType' on ColorModel.SPOT

- 'spotKind' on SpotColorKind.SPOTRGB

And that's work !!! Great !

3 replies

CarlosCanto
Community Expert
Community Expert
June 21, 2020

the full sample is in the scripting reference

 

//Creating a new spot color
// Creates a new spot color in the current document, then applies an 80% tint to the
color
if ( app.documents.length > 0 ){
var doc = app.activeDocument;
// Create the new spot
var newSpot = doc.spots.add();
// Define the new color value
var newColor = new CMYKColor();
newColor.cyan = 35;
newColor.magenta = 0;
newColor.yellow = 50;
newColor.black = 0;
// Define a new SpotColor with an 80% tint
// of the new Spot's color. The spot color can then
// be applied to an art item like any other color.
newSpot.name = "Pea-Green";
newSpot.colorType = ColorModel.SPOT;
newSpot.color = newColor;
var newSpotColor = new SpotColor();
newSpotColor.spot = newSpot;
newSpotColor.tint = 80;
}
June 23, 2020

Hello, Carlos!

Thanks for your answer, but I really want a Script or action to activate Global  property of  every Swatch.

June 21, 2020

Hello!

 

can you show us a more complete version of that solution?

 

Thanks.

kopaacabanaAuthorCorrect answer
Inspiring
October 18, 2018

Sorry,

In fact I found the solution.

I need to create a SpotColor and define properties :

- 'colorType' on ColorModel.SPOT

- 'spotKind' on SpotColorKind.SPOTRGB

And that's work !!! Great !