5 Replies Latest reply on Nov 11, 2012 11:51 PM by sundar_r

    overprint selective stroke colour

    rajnikids Level 1

      Hi,

       

      Can anybody help this.

       

      im trying to overprint stroke "Infill Magenta" colour using the below script; but error exist;

       

       

      //Set find & change preferences

      app.findObjectPreferences.strokeColor = "Infill Magenta";

      app.changeObjectPreferences.overprintFill = true; // this is changed from your original

      app.documents[0].changeObject(); // a change won't happen if you don't call it.

        • 1. Re: overprint selective stroke colour
          Jump_Over Level 5

          Hi,

           

          make it:

          app.changeObjectPreferences.overprintStroke = true;

           

          instead of

          app.changeObjectPreferences.overprintFill = true;

           

          and say something about this error

          rgds

          • 2. Re: overprint selective stroke colour
            sundar_r Level 1

            Hi Rajini,

             

            You requesting for objects and strokes? If so try this, this will change the stroke to Overprint for all objects and rules filled with magenta swatch.

             

            //apply overprint stroke or fill

             

             

            var mydoc=app.documents.item(0);

            var myOPs=mydoc.pageItems;

             

             

            for (i=0;i<myOPs.length;i++) {

                var myOP=myOPs[i];

                //swatch name OP

            if (myOP.strokeColor.name=="OP") {

                myOP.overprintStroke=true;

            }

            }

             

            Sundar

            • 3. Re: overprint selective stroke colour
              rajnikids Level 1

              thanks sundar jee,

               

              i also tried for fill colour at the same time...

               

              //apply overprint stroke or fill

               

               

              var mydoc=app.documents.item(0);

              var myOPs=mydoc.pageItems;

               

               

              for (i=0;i<myOPs.length;i++) {

                  var myOP=myOPs[i];

                  //swatch name OP

              if (myOP.strokeColor.name=="Infill Magenta") {

                  myOP.overprintStroke=true;

              }

              else if (myOP.fillColor.name=="Infill Magenta") {

                  myOP.overprintFill=true;

              }

              }

               

              Is the method right./

               

              thanks

              rajnikanth..

              • 4. Re: overprint selective stroke colour
                rajnikids Level 1

                Hi Sundar jee,

                 

                Correct this loop and simplify for overprinting text, fill and stroke... its a hint from your...

                I feel it a long loop,, instead can I have it in a simplified steps.

                 

                 

                var mydoc=app.documents.item(0);

                var myOPs=mydoc.pageItems;

                var myannos=mydoc.stories.everyItem().getElements();

                 

                for (i=0;i<myOPs.length;i++) {

                    var myOP=myOPs[i];

                    //swatch name OP

                if (myOP.strokeColor.name=="Infill Magenta") {

                    myOP.overprintStroke=true;

                }

                else if (myOP.fillColor.name=="Infill Magenta") {

                    myOP.overprintFill=true;

                }

                }

                for (i=0;i<myannos.length;i++) {

                    var myanno=myannos[i];

                  

                if(myanno.fillColor.name=="Infill Magenta") {

                    myanno.overprintFill=true;

                }

                }

                 

                thanks

                rajnikanth

                • 5. Re: overprint selective stroke colour
                  sundar_r Level 1

                  I am also a beginner like you, so I don't know how to simplify this. But this did all the requirements. I think this is an achivement for me