2 Replies Latest reply on Jul 30, 2014 9:55 AM by KenWK

    Table in multiple text frames

    KenWK Level 1

      I have a script that goes page for page and splits the stories in a document into individual frames and I'm trying figure out how to handle tables that span multiple pages. Like the "SplitStory" script that out there somewhere it copies the frame and pastes it to separate it, but before doing so it does some things to avoid hyphenated words at the end of the frame. So, I need to be able to detect when the frame contains a table.


      The first frame that contains a table has a "Tables.Count" value (sorry, VB not Java) but subsequent frames do not indicate they have a table, or characters, and only 1 insertion point.


      Is there something I'm missing that would indicate that the frame contains the middle or end of a table?




        • 1. Re: Table in multiple text frames
          Jump_Over Level 5



          SplitStory does a job with a tables as well, doesn't?

          It does it using the same procedure: duplicate a frame and remove original (in thread doing this backward).


          To indicate a parentTextFrame of a specific row you can check this property for any text object of this row.cells, i.e.



          (that is javascript)



          • 2. Re: Table in multiple text frames
            KenWK Level 1

            I checked at the object model for ParentTextFrame on rows and cells but didn't think to try getting the ParentTextFrame of an InsertionPoint in a cell, in a table. That seems to work though!


            I'm not sure about the SplitStory script, I don't recall exactly how it works. I couldn't use it as it was because I need to check things and take some actions BEFORE I duplicate the frame.


            Using the ParentTextFrame of an InsertionPoint inside a cell should at least allow me to loop through the rows of the table and, maybe, mark the frames in which the table flows.


            More work to do but at least now I have a direction in which I can start.


            Thanks a bunch for replying!!