3 Replies Latest reply on Dec 10, 2008 8:07 AM by (Jonathon_Anderson)

    finding the end of page in a multi

      Hi scriptors!!!! I am new to scripting and am trying to find the end of a text flow on a page. I have a multi page document, several text frames on the pages and it is all linked together as one flow of text. I need to find the point where the text finishes on page 1 and starts on page 2. is there a way to find this with scripting?

      Thanks alot for any help!
        • 1. Re: finding the end of page in a multi
          Level 1
          I am using CS3 Middle East Edition on WinXP Pro, looking to do this either in VB or JS.
          • 2. Re: finding the end of page in a multi
            Level 1
            Hi Jonathon Anderson,

            The last insertion point on page 1 would be (JavaScript form):

            //Given a document "myDocument"...
            
            var myLastInsertionPoint = myDocument.pages.item(0).textFrames.item(0).insertionPoints(-1);

            The first insertion point on page 2 would be:

            var myFirstInsertionPoint = myDocument.pages.item(1).textFrames.item(0).insertionPoints.item(0);
            

            Thanks,

            Ole
            • 3. Re: finding the end of page in a multi
              Level 1
              Hi Ole,

              Thanks a lot! I am sorry if this sounds weird, But I am really new, I can't seem to find out what to do with this code. Do you mind to help me in "filling in the gaps"?

              Maybe I can tell you what I am trying to do so that you can understand.

              I have a 200+ page indd doc that has several text flows, But one main text flow that contains the majority of the text. When the copy is final and approved, I need to export that main flow to word and then make insert PageBreaks in the Word file according to the indd file.

              My idea is to insert a special character that I can then replace (in word) to a Pagebreak. The word part is very easy. What I need help with is to run a script that will loop each page in my indd doc and find the last character in the last text frame and insert a special character that will not re-flow the text.

              I hope you can help me with this. I would very much appreciate any help you can assist me with!

              Thanks, Jonathon