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

Replace colors

Community Beginner ,
Sep 01, 2017 Sep 01, 2017

Hello,

I have a InDesign-Document with a lot of colors. This colors I have to change now.

The names would be the same, but the color separation is different.

The problem is now, that i have a lot of those documents to change the colors.

I created a new color library and now i would like to change it in all documents.

But the colors are not replaced… i get all colors twice.

Is there a way to replace the colors?

Thanks for your help.

Nadine

TOPICS
Scripting
2.3K
Translate
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
Guide ,
Sep 01, 2017 Sep 01, 2017

What about creating a book?

Insert all the documents you need to change in the book, select as Source the file with the correct new colors.

Open Sync Options and make sure you keep only the Swatch option (otherwise you may badly modify your files: styles etc...)

Finally Synchronize.

Not tested but should work.

I recommend you create a backup first...

Translate
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
Community Beginner ,
Sep 01, 2017 Sep 01, 2017

I will try it.

But i thing this is not the way i am looking for.

I have more than 100.000 documents...

But i will try it thank you!

Translate
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
Guide ,
Sep 01, 2017 Sep 01, 2017

100.000 documents? You work for McDonald's?

In this case, I would suggest you hire a developer who will script a batch for you...

Translate
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
Community Expert ,
Sep 01, 2017 Sep 01, 2017

Move to this discussion to InDesign Scripting forum.

Provably, will get some helpful mentions in there.

Translate
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
LEGEND ,
Sep 01, 2017 Sep 01, 2017

Yeap!  …

Just place the 100,000 ID files in a folder "X files" and play:

The script allows the op to choose this folder "X files". Then let's the script play its music alone: it opens the first 10 files, run this kind of code lines

    on each file, save and close it.

app.activeDocument.colors.item("color_A").colorValue = [50,0,0,0];

app.activeDocument.colors.item("color_B").colorValue = [0,0,100,0];

…

When the 10 files have been treated, the script goes on the next 10 and so on! …

Simple! 

(^/)

Translate
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
People's Champ ,
Sep 01, 2017 Sep 01, 2017

A concern I would adress is that InDesign would probably suffer from performance issues if you run a script over 100k files in a row 😕

But yes a script is indeed the way to go.

Translate
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
Community Beginner ,
Sep 01, 2017 Sep 01, 2017

Thank you, i will try that

Translate
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
Community Beginner ,
Sep 01, 2017 Sep 01, 2017

I will try it.

If I have a result, I will report.

Thank all of you for your help!

Translate
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
LEGEND ,
Sep 01, 2017 Sep 01, 2017

I think the real question is:

Can a folder contain 100,000 files?

(^/) 

Test on a simple "5 ID files" folder:

Translate
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
Community Beginner ,
Sep 05, 2017 Sep 05, 2017

The script works

(I only try it in one document.)

Can you tell me who i can change form CMYK to LAB?

My new color values must be LAB...

Translate
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
Engaged ,
Sep 05, 2017 Sep 05, 2017

Hi,

var myDoc = app.activeDocument; 

var mySwatch = myDoc.swatches; 

for (var j=4; j<mySwatch.length; j++)

{

    if(mySwatch.space ==ColorSpace.CMYK)

    {

        mySwatch.model=ColorModel.PROCESS; 

        mySwatch.space = ColorSpace.LAB;

       

        }

    }

Thanks,

Prabu

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.
Translate
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
Guide ,
Sep 05, 2017 Sep 05, 2017
LATEST

Prabhu,

Just adding a point to you script.

I had faced a strange problem. The customer moved the bottom swatch from top 2nd position. So when I start the for loop from 4, it ignores the required check one in the top list !!!.

So better avoid this we need to sort swatches by name then proceed with j=4. Otherwise we need to mention the top 4 swatch name to ignore in checking.

Thanks,

K

Translate
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
Community Expert ,
Sep 01, 2017 Sep 01, 2017

This should be very well to do with a custom script. But for such a number of changes, with all the careful testing before letting it loose on 100,000 documents, a continuous to-and-fro on a forum would not be the best option.

Look for an accomplished script writer in your region and invite him/her to come over and look at a few sample documents and your folder structure.

Translate
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
People's Champ ,
Sep 01, 2017 Sep 01, 2017

That, I just exclude it. I am presuming files are dispatched over network drives or sub folders…

Translate
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
LEGEND ,
Sep 01, 2017 Sep 01, 2017

Me too! 

So, the Question is:  How find them?! …

(^/)

Translate
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