0
Explorer
,
/t5/illustrator-discussions/adjust-script-to-create-processs-and-rgb-swatches/td-p/13897158
Jun 27, 2023
Jun 27, 2023
Copy link to clipboard
Copied
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
scott
TOPICS
How-to
,
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
2 Correct answers
Guide
,
Jun 27, 2023
Jun 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"
Guide
,
Jun 27, 2023
Jun 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"
Explore related tutorials & articles
Guide
,
/t5/illustrator-discussions/adjust-script-to-create-processs-and-rgb-swatches/m-p/13897251#M371620
Jun 27, 2023
Jun 27, 2023
Copy link to clipboard
Copied
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"
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
@Js1212
AUTHOR
Explorer
,
/t5/illustrator-discussions/adjust-script-to-create-processs-and-rgb-swatches/m-p/13897255#M371621
Jun 27, 2023
Jun 27, 2023
Copy link to clipboard
Copied
thank you...and how to make the CMYK version?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/illustrator-discussions/adjust-script-to-create-processs-and-rgb-swatches/m-p/13897261#M371622
Jun 27, 2023
Jun 27, 2023
Copy link to clipboard
Copied
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"
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
@Js1212
AUTHOR
Explorer
,
LATEST
/t5/illustrator-discussions/adjust-script-to-create-processs-and-rgb-swatches/m-p/13897281#M371623
Jun 27, 2023
Jun 27, 2023
Copy link to clipboard
Copied
THANK YOU!!!!!
scott
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

