2 Replies Latest reply on Jun 16, 2011 12:13 PM by ScribeTypesetDept

    Search for the end of each text frame?

    ScribeTypesetDept Level 1

      I'd like to insert some kind of marker at the end of each of my text frames in order to preserve where the page breaks occur, even after I've exported my file. The only function in InDesign that seems to recognize pages is the text variables that can pull the first/last instance of something on a page. Other than that, I can find no way of searching for the end of a page or end of a text frame.

        • 1. Re: Search for the end of each text frame?
          TᴀW Adobe Community Professional & MVP
          myFrames = app.activeDocument.textFrames;
          myCharStyle = app.activeDocument.characterStyles.itemByName("Marker");
          for (a=0; a<myFrames.length; a++){
               if (myFrames[a].characters.length>0){
                    myFrames[a].characters[-1].appliedCharacterStyle = myCharStyle;
               }
          }
          

           

          The above script will apply a character style called Marker to the last character of all text frames in the document (prepare a character style called Marker [case-sensitive] before you run the script, or change the name in the second line.

           

          I guess a character style isn't an ideal solution, though, as it might override something else.

           

          Perhaps a strikethrough? In which case, change the 5th line to:

           

          myFrames[a].characters[-1].strikeThru = true;
          

           

          Does that help?

           

          Ariel

          www.FreelanceBookDesign.com

           

          Message was edited by: Arïel to correct syntax error.

          • 2. Re: Search for the end of each text frame?
            ScribeTypesetDept Level 1

            thanks for responding, I'll give it a try.