• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

convert swatches color to CMYK

Participant ,
Aug 08, 2024 Aug 08, 2024

Copy link to clipboard

Copied

Hello , everyone.
I want to change the color of the text to CMYK with convert swatch color, but it fails.

when I manually convert it and GLOBAL option is checked, that's successful.

but below script did not make GLOBAL option checked.

Is it possible?

 

ruihuang_0-1723101829790.png

 


var newColor = new CMYKColor();
newColor.black = 100;
newColor.cyan = 0;
newColor.magenta = 0;
newColor.yellow = 0;

var ignoreColors = ['[None]', '[Registration]'];
var doc = activeDocument;
var swatches = doc.swatches;
for (var i = 0; i < swatches.length; i++) {
var shouldIgnore = false;
for (var j = 0; j < ignoreColors.length; j++) {
if (swatches[i].name === ignoreColors[j]) {
shouldIgnore = true;
break;
}
}
if (!shouldIgnore) {
alert(swatches[i].name);
swatches[i].color = newColor;
}
}

TOPICS
Scripting

Views

104

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Aug 08, 2024 Aug 08, 2024

@Charu Rajput , Thanks for sharing how to change fill and stroke color by directly replacing the color, solved my problem.


https://community.adobe.com/t5/illustrator-discussions/change-color-swatch-to-other-color-swatch/m-p/13487155

Votes

Translate

Translate
Adobe
Participant ,
Aug 08, 2024 Aug 08, 2024

Copy link to clipboard

Copied

LATEST

@Charu Rajput , Thanks for sharing how to change fill and stroke color by directly replacing the color, solved my problem.


https://community.adobe.com/t5/illustrator-discussions/change-color-swatch-to-other-color-swatch/m-p...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines