6 Replies Latest reply on Mar 12, 2013 12:55 AM by seb400

    apply colour swatch

    seb400 Level 1

      Hi

       

      Intel iMac, CS6

       

      Help required please, I can't find any reference/s to a script that will change the colour of an item - in this case an image.

       

      I have a document containing greyscale images and would like to apply a 'mixed ink swatch' to each grayscale image to give a duo-tone effect.

       

      Is such a thing possible?

       

      MTIA, Steve

        • 1. Re: apply colour swatch
          Harbs. Level 6

          How would you do what you want in the UI? That's usually the first question you need to ask yourself when figuring out how to script it.

           

          Harbs

          • 2. Re: apply colour swatch
            seb400 Level 1

            Hi Harbs

             

            I'm afraid it's beyond my understanding scriptwise (javascript). I would want to select all grayscale images with a default fill colour of black and apply a fill colour of 'defined mix'.

             

            sounds possible, but beyond my grasp.

             

            I did search in the hope of finding something similar to adapt.

             

            Steve

            • 3. Re: apply colour swatch
              Harbs. Level 6

              I'm not 10% sure what you are trying to do.

               

              Is this something that you can do manually in the user interface?

               

              Harbs

              • 4. Re: apply colour swatch
                seb400 Level 1

                Hi Harbs (I'm not 10% sure too!)

                 

                all I'm trying to do is to convert multiple grayscale images in a document to duotones using an InDesign mixed ink swatch.

                I can do it manually but there are multiple images to convert.

                 

                After further searching I did find this (which works)

                 

                http://www.lapay.biz/adobeindesignscriptfindchangebycolor2

                 

                but it's way more involved than I need - I will see if I can pare it down to the specifics I need (after translating the Russian comments!).

                 

                Which is to identify all grayscale images and colour them with a defined mixed ink swatch/pseudo duo-tone.

                 

                Steve

                • 5. Re: apply colour swatch
                  Muppet Mark Level 5

                  Not looked at your link but a rough n dirty way would be to apply the mixed ink to all graphics… Only the grayscales will take this…?

                   

                  #target indesign
                  
                  mixedInkImages();
                  
                  function mixedInkImages() {
                    
                            var i, count, doc, ink;
                    
                            doc = app.activeDocument;
                    
                            count = doc.allGraphics.length;
                    
                            ink = doc.mixedInks.itemByName( 'elmo' ); // Your mixed ink name here
                    
                            for  ( i = 0; i < count; i++ ) {
                    
                                      try {
                    
                                                doc.allGraphics[i].fillColor = ink;
                    
                                      } catch(e) {};
                    
                            };
                    
                  };
                  
                  • 6. Re: apply colour swatch
                    seb400 Level 1

                    Hi Mark

                     

                    that's just what I was looking for, thanks

                     

                    Steve