3 Replies Latest reply on Nov 21, 2012 1:01 AM by babeanz

    colour merging scripts

    babeanz

      I need to change the RGB values (imported from word) to specific CMYK values in Indesign (its not a straight swop) so I need a script or a similar plug-in that enables me to input the colour values for the CMYK so they automatically change.... the doc i work on is huge and im importing from a word file many times so i need to save time!!

       

      Can anyone help me?

       

      Thank you!

        • 1. Re: colour merging scripts
          babeanz Level 1

          Can anyone adapt this script to the colour values merge so once the script has finished running i dont have duplicate colour values in my swatch pallette?

           

          var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R122_G75_B153"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space=ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[48,72,0,0];

                           mySwatch[j].name= "C=48 M=72 Y=0 K=0_1"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

           

            var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R255_G255_B255"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[0,0,0,0];

                           mySwatch[j].name= "C=0 M=0 Y=0 K=0"

                          

                           }

                       }

                   }catch(e){alert(e)}

               }

           

           

             var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R0_G0_B0"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[0,0,0,100];

                            mySwatch[j].name= "C=0 M=0 Y=0 K=100_1"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

           

              var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R0_G0_B255"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[100,0,0,0];

                            mySwatch[j].name= "C=100 M=0 Y=0 K=0_1"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

               var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R255_G0_B255"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[0,100,0,0];

                            mySwatch[j].name= "C=0 M=100 Y=0 K=0_1"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

                var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R132_G71_B255"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[48,72,0,0];

                            mySwatch[j].name= "C=48 M=72 Y=0 K=0_2"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

                var myIDOc = app.activeDocument;

          var mySwatch = myIDOc.swatches;

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

              try{

                   if(mySwatch[j].space ==ColorSpace.RGB){

                       if(mySwatch[j].name=="Word_R234_G229_B255"){// may be this is correct you can check the indesign swatches name

                           mySwatch[j].model=ColorModel.PROCESS;

                           mySwatch[j].space = ColorSpace.CMYK;

                           var myCV = mySwatch[j].colorValue=[8,10,0,0];

                            mySwatch[j].name= "C=8 M=10 Y=0 K=0_1"

           

                           }

                       }

                   }catch(e){alert(e)}

               }

           

          Screen Shot 2012-11-20 at 09.44.36.png

          • 2. Re: colour merging scripts
            csm_phil Level 4

            Hi Babe,

             

            Please try the below JS code.

             

             

            var myIDOc = app.activeDocument;
            var mySwatch = myIDOc.swatches;
            for (j=mySwatch.length-1; j>=0; j--){
                try{
                     if(mySwatch[j].space ==ColorSpace.RGB){
                         if(mySwatch[j].name=="Word_R122_G75_B153"){
                            mySwatch[j].remove("C=48 M=72 Y=0 K=0");
                            }
                        else if(mySwatch[j].name=="Word_R255_G0_B255"){
                            mySwatch[j].remove("C=0 M=100 Y=0 K=0");
                            }
                        else if(mySwatch[j].name=="Word_R0_G0_B255"){
                            mySwatch[j].remove("C=100 M=0 Y=0 K=0");
                            }
                        else if(mySwatch[j].name=="Word_R0_G0_B0"){
                            mySwatch[j].remove("Black");
                            }
                        else if(mySwatch[j].name=="Word_R234_G229_B255"){
                            mySwatch[j].remove("C=8 M=10 Y=0 K=0");
                            }
                         }
                     }catch(e){}
                 }
            

             

             

            thx,

            csm_phil

            • 3. Re: colour merging scripts
              babeanz Level 1

              Thankyou csm_phil, you have been extremely helpful and i cant thank you enough!