9 Replies Latest reply on Jun 20, 2011 3:15 AM by Stix Hart

    Transferring Photoshop swatches into InDesign

    Stix Hart Level 5

      Anybody have any good tips for this?  Specifically I'm wanting an easy way to get swatches from Pictaculous.com into InDesign, the website generates a Photoshop swatches file, which I can load into Photoshop, export to ASE, load into InDesign, delete the 100 odd others that I didn't want and then convert to CMYK, but I thought there might be some shortcuts.

        • 1. Re: Transferring Photoshop swatches into InDesign
          Steve Werner Adobe Community Professional & MVP

          Using ASE swatches is the shortcut.

           

          Of course, if you were an ace scripter, you'd build a script to do it all. It sound a bit too specialized to expect that anyone else has developed such a script but you might ask in the InDesign Scripting forum.

          • 2. Re: Transferring Photoshop swatches into InDesign
            [Jongware] Most Valuable Participant

            That was fun

            Here is a first go at a Javascript. The ACO file format is not documented (or -- to be honest -- it seems so easy I didn't bother to look it up), so I made a couple of assumptions about what values mean what. Then again, this site always generates the same format, so I guess it ought to work for this purpose alone.

             

            //DESCRIPTION:Import ACO swatches
            // A Jongware Script 20-Jun-2011
            acoFile = File.openDialog("Select an ACO file", "PhotoShop ACO:*.aco", true);
            if (acoFile == null)
              exit(0);
            myFile = File(acoFile);
            if (myFile.open("r") == false)
              exit(0);
            myFile.encoding = "binary";
            myFile.read (2);
            number = (myFile.read (1).charCodeAt(0)<<8) + myFile.read (1).charCodeAt(0);
            for (i=0; i<number; i++)
            {
             argb = myFile.read (8);
             unkn = myFile.read(4);
             namelen = (myFile.read (1).charCodeAt(0)<<8) + myFile.read (1).charCodeAt(0);
             myFile.encoding = "UTF-16BE";
             name = myFile.read (namelen);
             myFile.encoding = "binary";
             if (name.charCodeAt(namelen-1) == 0)
              name = name.substring(0,namelen-1);
             red = argb.charCodeAt(2);
             green = argb.charCodeAt(4);
             blue = argb.charCodeAt(6);
             sw = app.activeDocument.colors.add({space:ColorSpace.RGB, colorValue:[red,green,blue],name:name});
             sw.space = ColorSpace.CMYK;
            }
            myFile.close();
            
            • 3. Re: Transferring Photoshop swatches into InDesign
              Eugene Tyson Adobe Community Professional & MVP

              From the Swatches Panel in Photoshop if you go to Save Swatches for Exchange

               

              Then navigate to the InDeisgn Swatches preset folder

               

              Adobe InDesign CS5\Presets\Swatch Libraries

               

              Save the ASE here and the swatches are available from the "New Swatch" in InDesign - here I've named the ASE file Photoshop Swatches

               

              Untitled-1.jpg

              1 person found this helpful
              • 4. Re: Transferring Photoshop swatches into InDesign
                Stix Hart Level 5

                Wow, I sure didn't expect something that cool!  Thanks heaps Jongware, hopefully someone else gets some use of this too.  For anyone who's interested pictaculous takes any image and generates a pallete of complimentary colours, it's results are surprisingly cool.  Good for a start when you've got designers block anyway.

                 

                The only modification I'd suggest to that script is to round the CMYK percentages off to no decimal places and to name them by their CMYK mix, is that possible?  I'm pretty sure I've read some discussio before on scripting that type of thing...  You don't have to if you can't bothered, what you've done is awesome! 

                1.png

                • 5. Re: Transferring Photoshop swatches into InDesign
                  Stix Hart Level 5

                  @ Eugene, yeah that's a better way than I was using, obviously not as fast as Jongware's script though.

                  • 6. Re: Transferring Photoshop swatches into InDesign
                    Eugene Tyson Adobe Community Professional & MVP

                    Well a script is pretty cool! Can't beat that really. I wouldn't be often bringing swatches in from Photoshop anyways

                     

                    Saving ASE works for any ASE, illustrator and all. Just another option if you ever get ASE swatches from clients.

                     

                    I used to load about 14 swatches into all new InDesign files for a client and only use one of them for whatever product they were using.

                     

                    Doing it that way, I can load just the one swatch that's needed for that product and not clog my Swatches Panel with unwanted swatches.

                     

                    Because when you simply use Load Swatches you don't get a choice of what swatch to bring in.

                     

                     

                    I'm finding the ASE in the Swatches Presets a bit easier to work with than loading 14 swatches every time.

                    • 7. Re: Transferring Photoshop swatches into InDesign
                      [Jongware] Most Valuable Participant

                      Stix Hart wrote:

                      [..] The only modification I'd suggest to that script is to round the CMYK percentages off to no decimal places and to name them by their CMYK mix, is that possible?

                       

                      The values in the ACO file are in RGB and I don't convert them myself to CMYK. I just create a new RGB Swatch, and then tell InDesign to convert it to CMYK. That said, it 's possible to adjust the values and name afterwards:

                       

                      //DESCRIPTION:Import ACO swatches
                      // A Jongware Script 20-Jun-2011
                      acoFile = File.openDialog("Select an ACO file", "PhotoShop ACO:*.aco", true);
                      if (acoFile == null)
                        exit(0);
                      myFile = File(acoFile);
                      if (myFile.open("r") == false)
                        exit(0);
                      myFile.encoding = "binary";
                      myFile.read (2);
                      number = (myFile.read (1).charCodeAt(0)<<8) + myFile.read (1).charCodeAt(0);
                      for (i=0; i<number; i++)
                      {
                       argb = myFile.read (8);
                       unkn = myFile.read(4);
                       namelen = (myFile.read (1).charCodeAt(0)<<8) + myFile.read (1).charCodeAt(0);
                       myFile.encoding = "UTF-16BE";
                       name = myFile.read (namelen);
                       myFile.encoding = "binary";
                       if (name.charCodeAt(namelen-1) == 0)
                        name = name.substring(0,namelen-1);
                       red = argb.charCodeAt(2);
                       green = argb.charCodeAt(4);
                       blue = argb.charCodeAt(6);
                       try {
                        sw = app.activeDocument.colors.add({space:ColorSpace.RGB, colorValue:[red,green,blue]});
                        sw.space = ColorSpace.CMYK;
                        sw.colorValue = [ Math.round(sw.colorValue[0]), Math.round(sw.colorValue[1]), Math.round(sw.colorValue[2]), Math.round(sw.colorValue[3]) ];
                        sw.name = "C="+sw.colorValue[0]+" M="+sw.colorValue[1]+" Y="+sw.colorValue[2]+" K="+sw.colorValue[3];
                       } catch (_) { }
                      }
                      myFile.close();
                      

                       

                       

                      I also tested with a couple of ACO files saved directly from Photoshop, and, as I guessed, it *does* support a few more color spaces. I wrote up a more complete script that can read most common color formats (no mixed inks or whatnots), so you can use it on 'general' ACO files as well:

                       

                      http://www.jongware.com/binaries/importACO.zip

                      1 person found this helpful
                      • 8. Re: Transferring Photoshop swatches into InDesign
                        Stix Hart Level 5

                        Absolutely brilliant!  Thanks heaps for your help, may your camels always stand downwind of you.

                        • 9. Re: Transferring Photoshop swatches into InDesign
                          Stix Hart Level 5

                          Yeah I use ASE quite a bit but only through the "Load Swatches" command, your way, or for a one off clicking on the "Other Library..." option is definitely better.