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.
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
999 21 1
When I convert text frame to table I get i as
Aluminum Castings & Extrusions etrfsf 1 45 1 edc 1 79 1 CONFIG2 1 16 1 CONFIG3 1 79 1 cg 1 sdsf 1 wer 1 999 1 21 1
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 etrfsf 45 1 edc 79 1 CONFIG2 16 1 CONFIG3 79 1 cg 1 sdsf 1 wer 1 999 21 1