2 Replies Latest reply on May 24, 2017 2:28 AM by revathiv80720177

    Indesign Text Frame to Tables

    revathiv80720177 Level 1

      Hi

      I have to convert my text frame to table.I am using this script

      app.activeDocument.textFrames[0].texts[0].convertToTable("\t","\r");  .

       

      This converts my text frame of one column to table of one column.But I have to convert the text frame of one column to text frame of two columns.how shall I do this using script?

       

      Regards,

      Revathi

        • 1. Re: Indesign Text Frame to Tables
          Laubender Adobe Community Professional & MVP

          Hi Revathi,

           

          If you try this with "\t" and expect two columns you need tab characters as column separators in the text.

          If there is no one and you like to have an empty column you would add tab characters first and then convert to table.

           

          You could add one at the beginning of every paragraph of your text if the empty column should be the first column or you add one at the end of your first paragraph only if you want the empty column after the text.

           

          Or do you like a different column separator character that is provided in the text?

          Then use that character as the first argument of your convertToTable() method.

           

          Regards,

          Uwe

          • 2. Re: Indesign Text Frame to Tables
            revathiv80720177 Level 1

            Hi Lubender,

             

            I have to export the product codes,its price and page number from InDesign document to excel.I have go product code,price and page number by  Table of Contents by using scripts. I get it as text frame with values one by one.I am able to convert it to table as it is.

             

            Aluminum Castings & Extrusions

            etrfsf 45 1

            edc 79 1

            CONFIG2 16 1

            CONFIG3 79 1

            cg 1

            sdsf 1

            wer 1

            999 21 1

            When I convert text  frame to table I get i as

             

            Aluminum Castings & Extrusions
            etrfsf1
            451
            edc1
            791
            CONFIG21
            161
            CONFIG31
            791
            cg1
            sdsf1
            wer1
            9991
            211

             

            But what want is shown below I got this by manually altering the table and converted it.But I have to my text frame to table as shown below using scripts.Is it possible?

             

            Aluminum Castings & Extrusions
            etrfsf451
            edc791
            CONFIG2161
            CONFIG3791
            cg1
            sdsf1
            wer1
            999211

             

             

            Regards,

            Revathi