Skip to main content
Known Participant
June 27, 2023
Answered

adjust script to create processs and RGB swatches

  • June 27, 2023
  • 1 reply
  • 601 views

i need to two seperate scripts...
1 that will make a process color swatch
and a second that will create a RGB swatch


i have been using this to create my spot color swatch but i do not know what needs to be revised to make the two additional versions that i need

try { var newSpot = app.activeDocument.swatches.getByName("SPOT 262"); alert("spot 262 already exists")}
catch (e) {
var newSpot = app.activeDocument.spots.add();
var newColor = new CMYKColor();
newColor.cyan = 52;
newColor.magenta = 92;
newColor.yellow = 12;
newColor.black = 50;
newSpot.name = "SPOT 262";
newSpot.colorType = ColorModel.SPOT;
newSpot.color = newColor;
var newSpotColor = new SpotColor();
newSpotColor = newSpot;
newSpotColor.tint = 100;
}
//alert("done"); }
 
as always, any help is appreciated

scott
This topic has been closed for replies.
Correct answer femkeblanco
var colour2 = new CMYKColor();
colour2.cyan = 0;
colour2.magenta = 100;
colour2.yellow = 100;
colour2.black = 0;

swatch2 = app.activeDocument.swatches.add();
swatch2.color = colour2;
swatch2.name = "Red 2"

1 reply

femkeblanco
Legend
June 27, 2023
var colour1 = new RGBColor();
colour1.red = 250;
colour1.green = 0;
colour1.blue = 0;

swatch1 = app.activeDocument.swatches.add();
swatch1.color = colour1;
swatch1.name = "Red 1"
@Js1212Author
Known Participant
June 27, 2023

thank you...and how to make the CMYK version?

 

 

femkeblanco
femkeblancoCorrect answer
Legend
June 27, 2023
var colour2 = new CMYKColor();
colour2.cyan = 0;
colour2.magenta = 100;
colour2.yellow = 100;
colour2.black = 0;

swatch2 = app.activeDocument.swatches.add();
swatch2.color = colour2;
swatch2.name = "Red 2"