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

Permanently add swatches to my palette (old documents)

Explorer ,
Oct 22, 2020 Oct 22, 2020

Copy link to clipboard

Copied

Hello,

Newbie here.

I added my swatches to my CC library, which shows my swatches for NEW documents; however, each time I open an old document, I need to add my swatches to my palette from the library. Is there a way adjust my palette to show only the swatches I use (again, this is for previous documents, not new)? I work for a company and revise documents all the time & use only the same color swatches over & over. Very inconvenient to have to continually add the swatches to my palette from my library on every document. 

Thanks in advance for any advice!

 

TOPICS
How to

Views

598

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 2 Correct answers

Community Expert , Oct 23, 2020 Oct 23, 2020

You could get a list of your current default colors and add them to an old document via scripting. With the old document in front, try running this script:

 

//an existing document
var olddoc = app.activeDocument;
//a list of the old document‘s colors
var oldSwatches = getSwatchList(olddoc.swatches)

//open a new doc to get current default colors
var defdoc = app.documents.add();
var defColors = defdoc.swatches;


//add the default colors to the old doc
for (var i = 0; i < defColors.length; i++)
...

Votes

Translate

Translate
Community Expert , Dec 04, 2020 Dec 04, 2020

With no documents open create the desired swatches (or load an .ase swatches file) and restart ID. 

 

There is an option to migrate your preferences when you upgrade, in the future you might want to do that.

Votes

Translate

Translate
People's Champ ,
Oct 23, 2020 Oct 23, 2020

Copy link to clipboard

Copied

I don't think there is, for preexisting documents. If you add the swatch with all docs closed, it will be there when you create a new doc.

 

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
Explorer ,
Oct 23, 2020 Oct 23, 2020

Copy link to clipboard

Copied

Thanks for your response. They're there when I start a new doc, but I update existing docs daily and was hoping there was a way to add the swatches so they're in my palette when I open an existing doc. 

Thanks again!

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
Community Expert ,
Oct 23, 2020 Oct 23, 2020

Copy link to clipboard

Copied

You could get a list of your current default colors and add them to an old document via scripting. With the old document in front, try running this script:

 

//an existing document
var olddoc = app.activeDocument;
//a list of the old document‘s colors
var oldSwatches = getSwatchList(olddoc.swatches)

//open a new doc to get current default colors
var defdoc = app.documents.add();
var defColors = defdoc.swatches;


//add the default colors to the old doc
for (var i = 0; i < defColors.length; i++){
    if (!checkItem(oldSwatches, defColors[i].name)) {
        var p = defColors[i].properties;
        var s = olddoc.colors.add();
        s.properties = p;
    } 
};  

//close the defaults doc
defdoc.close(SaveOptions.NO)


/**
* Checks if an item is in an array
* @Param the array to check 
* @Param the item to look for 
* @Return true if the item is in the array 
* 
*/
function checkItem(a, obj) {
    for (var i = 0; i < a.length; i++) {
        if (a[i] === obj) {
            return true;
        }
    }
    return false;
}


/**
* get a list of swatch names 
* @Param an array of swatches 
* @Return a name list 
* 
*/
function getSwatchList(a){
    sList = []
    for (var i = 0; i < a.length; i++) {
        sList.push(a[i].name)
    }
    return sList; 
}

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
Explorer ,
Oct 23, 2020 Oct 23, 2020

Copy link to clipboard

Copied

Rob, 

You're a genius! That worked like a charm! 

Thanks so much for your help!

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
Explorer ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

@rob day Since I installed the 2021 update, unfortunately, this script no longer works. It was working beautifully and made my work flow so much more efficient.

Is there a different script I could try for 2021 InDesign?

Thanks a million!

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Are you getting an error dialog?

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
Explorer ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

No error, the colors just no longer appear in my swatch panel. 

 

Thanks for any guidance. 

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

When you did the update did you update your custom default swatches with no documents open?

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
Explorer ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

No, I didn't. I didn't realize I needed to and don't know how. 

Would you please advise on how to do that?

 

Thank you!

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

With no documents open create the desired swatches (or load an .ase swatches file) and restart ID. 

 

There is an option to migrate your preferences when you upgrade, in the future you might want to do that.

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
Explorer ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

LATEST

That worked! Thank you again!

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