2 Replies Latest reply on May 3, 2011 2:29 AM by John Hawkinson

    change all textFrame

    jeanmed Level 1

      Hello

       

      How can i change le textFrame of all my document.

      I need to add a border all the textFrames.

       

      Can you help me ?

       

      Thanks

        • 1. Re: change all textFrame
          csm_phil Level 4

          Hi Jean,

           

          You have to use this js code:

           

          var myDoc = app.activeDocument;
          var myPg = myDoc.allPageItems;
          for (i=0; i<myPg.length; i++){
              var myFrame = myPg[i];
              if(myFrame instanceof TextFrame){
                      myFrame.strokeWeight="1pt";
                      myFrame.strokeColor="Black";
                  }
              }

           

          thx

          csm_phil

          1 person found this helpful
          • 2. Re: change all textFrame
            John Hawkinson Level 5

            "have to"? It's almost never true that one has to do it one way. There are often multiple ways,

             

            How about this:

            app.activeDocument.textFrames.everyItem().strokeWeight="1pt";
            app.activeDocument.textFrames.everyItem().strokeColor="Black";
            

             

            Shorter and faster (at least it should be). Won't catch frames in groups though. If you need that, then something like csm_phil's code is necessary.

            1 person found this helpful