14 Replies Latest reply on Oct 28, 2015 6:58 PM by Johnwhite

    Convert registration color to black

    LeoMari Level 2

      Hello everyone,

      I am looking for a script that converts Registration colors to CMYK Black ..

      It's possible?

      I appreciate the help!

      Hug..

        • 1. Re: Convert registration color to black
          Jump_Over Level 5

          Hi,

           

          You could use InDesign Find...Change utility to replace each "registration color" occurrence with "black color"

           

          So probably no need to use a script...

           

          Jarek

          • 2. Re: Convert registration color to black
            LeoMari Level 2

            Jarek Hello!

            Already do this but the idea is to incorporate this action to several other I'm writing. I want to reduce the number of clicks.

            I hope you understood my English is very bad ..

             

             

            Thank you!

             

             

            Leonardo

            • 3. Re: Convert registration color to black
              LeoMari Level 2

              I could !!

               

               

              You just need to do for the text ..

              Thank's!

               

              var doc = app.activeDocument;

              app.findObjectPreferences = app.changeObjectPreferences = null;

              app.findObjectPreferences.fillColor = "Registration"; 

              app.changeObjectPreferences.fillColor ="Black";

               

              app.changeObject();

               

              app.findObjectPreferences = app.changeObjectPreferences = null;

              • 4. Re: Convert registration color to black
                beto correa Level 1

                You can try this

                 

                var doc = app.activeDocument;

                app.findObjectPreferences = app.changeObjectPreferences = null;

                app.findObjectPreferences.fillColor = "Registration"; 

                app.changeObjectPreferences.fillColor = "Black"; 

                app.changeObject();

                app.findObjectPreferences = app.changeObjectPreferences = null;

                app.findObjectPreferences = NothingEnum.nothing;

                app.changeObjectPreferences = NothingEnum.nothing; 

                app.findObjectPreferences = app.changeObjectPreferences = null;

                app.findObjectPreferences.strokeColor = "Registration"; 

                app.changeObjectPreferences.strokeColor = "Black"; 

                app.changeObject();

                app.findObjectPreferences = app.changeObjectPreferences = null;

                app.findObjectPreferences = NothingEnum.nothing;

                app.changeObjectPreferences = NothingEnum.nothing; 

                app.findTextPreferences = app.changeTextPreferences = null;

                app.findTextPreferences.fillColor = "Registration"; 

                app.changeTextPreferences.fillColor = "Black"; 

                app.changeText();

                app.findTextPreferences = app.changeTextPreferences = null;

                app.findTextPreferences = NothingEnum.nothing;

                app.changeTextPreferences = NothingEnum.nothing; 

                app.findTextPreferences = app.changeTextPreferences = null;

                app.findTextPreferences.strokeColor = "Registration"; 

                app.changeTextPreferences.strokeColor = "Black"; 

                app.changeText();

                app.findTextPreferences = app.changeTextPreferences = null;

                • 5. Re: Convert registration color to black
                  Johnwhite Level 1

                  Hi Beto

                   

                  Find and Change Object Fill color and Stroke Color not really work.

                  Why?

                  Is that correct syntax?

                   

                  Regard

                  John

                  • 6. Re: Convert registration color to black
                    LeoMari Level 2

                    Hi John White!

                    Add #target indesign earlier in the code.

                    Work on the CS6 version of Mac and perfect works.

                    If not, error print post ..

                    hug!

                    • 7. Re: Convert registration color to black
                      Johnwhite Level 1

                      Hi LeoMari

                       

                      Thank you for you help.

                      But, not work.

                       

                      thaks

                      Regard

                      John

                      • 8. Re: Convert registration color to black
                        Johnwhite Level 1

                        Sorry all,

                         

                        Before run this script,

                        User have change the find-change object's options to all object,

                         

                        then it will work.

                         

                        But how can I tell the script I want to find and change in all objects?

                         

                        Regard

                        John

                        • 9. Re: Convert registration color to black
                          LeoMari Level 2

                          Important to all objects and layers unlocked. Also look for how to include the find/change options.

                           

                          I have these lines on unlocking:

                           

                          var myDocuments = app.documents.everyItem();

                          var myLayers = myDocuments.layers.everyItem();

                          myDocuments.pageItems.everyItem().locked = false;

                          myLayers.locked = false;

                          • 10. Re: Convert registration color to black
                            Johnwhite Level 1

                            Thank you LeoMari

                            thank you so much.

                             

                            John

                            • 11. Re: Convert registration color to black
                              Johnwhite Level 1

                              Sorry LeoMari

                               

                              It seems like I have to tell the script I want to change all kind of objects' fill color and stroke color. not all objects.

                              it seems these two tems have some different conditions.

                              I use you are script as above, but unfortunately not work.

                               

                              Regard

                              John

                              • 12. Re: Convert registration color to black
                                Johnwhite Level 1

                                Hi all,

                                 

                                Is I have to give a constructor.name, like

                                 

                                object.constructor.name = "GraphicLine";

                                object.constructor.name = "Rectangle";

                                object.constructor.name = "Oval";

                                object.constructor.name = "TextFrame"

                                 

                                What's the syntax for all kine of constructor.name?

                                 

                                Regard

                                John

                                • 13. Re: Convert registration color to black
                                  Johnwhite Level 1

                                  Hi Leo Mari

                                   

                                  I make this by myself, it works.

                                   

                                  var myDoc = app.activeDocument;
                                      var myObjects = myDoc.pageItems.everyItem().getElements();
                                            myDoc.pageItems.everyItem().locked = false;
                                              var myLayers = myDoc.layers.everyItem();
                                                     myLayers.locked = false;

                                              app.findObjectPreferences = app.changeObjectPreferences = null;
                                              app.findObjectPreferences.fillColor = "Registration"; 
                                              app.changeObjectPreferences.fillColor = "Black"; 
                                              app.changeObject();

                                              app.findObjectPreferences = app.changeObjectPreferences = null;
                                              app.findObjectPreferences = NothingEnum.nothing;
                                              app.changeObjectPreferences = NothingEnum.nothing; 
                                              app.findObjectPreferences = app.changeObjectPreferences = null;
                                              app.findObjectPreferences.strokeColor = "Registration"; 
                                              app.changeObjectPreferences.strokeColor = "Black"; 
                                              app.changeObject();

                                              app.findObjectPreferences = app.changeObjectPreferences = null;
                                              app.findObjectPreferences = NothingEnum.nothing;
                                              app.changeObjectPreferences = NothingEnum.nothing; 
                                              app.findTextPreferences = app.changeTextPreferences = null;
                                              app.findTextPreferences.fillColor = "Registration"; 
                                              app.changeTextPreferences.fillColor = "Black"; 
                                              app.changeText();

                                              app.findTextPreferences = app.changeTextPreferences = null;
                                              app.findTextPreferences = NothingEnum.nothing;
                                              app.changeTextPreferences = NothingEnum.nothing; 
                                              app.findTextPreferences = app.changeTextPreferences = null;
                                              app.findTextPreferences.strokeColor = "Registration"; 
                                              app.changeTextPreferences.strokeColor = "Black"; 
                                              app.changeText();

                                              app.findTextPreferences = app.changeTextPreferences = null;

                                   

                                  thank you for your help.

                                  thank you so much

                                   

                                  Regard

                                  John

                                  • 14. Re: Convert registration color to black
                                    Johnwhite Level 1

                                    thank you all.

                                     

                                    John