2 Replies Latest reply on Jan 8, 2015 8:24 AM by Stamm

    How to find out if textFrame is really a table?

    Stamm Level 1

      Hey, I tried to find a solution for this on Google and in the forums, but I couldn't find it.

       

      I also tried different things, like "currentItem.hasOwnProperty('tables')", but of course this is true for every textFrame. I am searching for something like "object.isTable". Does anyone have a hint on how to do this?

       

      Thanks in advance!

        • 1. Re: How to find out if textFrame is really a table?
          Laubender Adobe Community Professional & MVP

          @Stamm – look for the length of the tables in the text frame or in its parent story:

           

          if (myTextFrame.tables.length > 0){doSomething()};
          

           

          or:

          if(myTextFrame.parentStory.tables.length > 0){doSomething()};
          

           

          Where do you start from? From a known text frame or just an object you are not sure about?

          Or from an arbitrary selection the user is doing?

           

          Also consider a check, if the text frame is overset and the required table is fully or partly (some rows) is in the overflow.

           

          Uwe

          • 2. Re: How to find out if textFrame is really a table?
            Stamm Level 1

            Hey, thanks for the help already!

             

            It is about a known textFrame! The code is for xml export and it is checking every page item for its constructor and tagging it differently for different constructor names. The second example did it for me.

             

            1. if(myTextFrame.parentStory.tables.length > 0){doSomething()};

             

            Thank you really much!!