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

How to get CMYK values of all unnamed colours?

Participant ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

Hi Everyone,

 

I need to get all unnamed colours in indesign. But this colours are not shown in Swatches panel.

 

I tried the below code not retrieving the unnamed colours we used in document.

var allSwatches = app.documents[0].swatches;

 

Can anyone advise me to get the CMYK vlaues of all unnamed colours?

 

Thanks.

TOPICS
Scripting

Views

278

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

Community Expert , May 25, 2021 May 25, 2021

Hi @AD4003,

I have not tested it extensively but iterating the colors collection and picking colors that have a blank name should be the unnamed color list. So something like the following should work. The cymk value(if its a CMYK color) can be obtained from the colorValue property of the color

 

var unusedColor = []
for(var i = 0; i < app.documents[0].colors.length; i++)
{
	if(app.documents[0].colors[i].name == "")
		unusedColor.push(app.documents[0].colors[i])
}

 

-Manan

Votes

Translate

Translate
Community Expert ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

Hi @AD4003,

I have not tested it extensively but iterating the colors collection and picking colors that have a blank name should be the unnamed color list. So something like the following should work. The cymk value(if its a CMYK color) can be obtained from the colorValue property of the color

 

var unusedColor = []
for(var i = 0; i < app.documents[0].colors.length; i++)
{
	if(app.documents[0].colors[i].name == "")
		unusedColor.push(app.documents[0].colors[i])
}

 

-Manan

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
Participant ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

LATEST

Thank you so much Manan.

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