Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

142

Likes

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

Adobe Community Professional , 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

Likes

Translate

Translate
Adobe Community Professional ,
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

Likes

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.

Likes

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