Copy link to clipboard
Copied
I imported xml File into inDesign file that contains tables....
In inDesign document, I am getting the contents of a node, that contains table data with separator tab, but I am not converting this data into table.
And I am not getting Rows (i.e. line separator).
Can Anyone help me Please by giving the solution in JavaScript (JSX)
Thanks...
Copy link to clipboard
Copied
Hi there,
Here's what I do for tab delimited text. It shouldn't be too difficult to convert your data to this otherwise you may have to edit your XML to include the table structure instead (which is a pain imo).
app.activeDocument.textFrames[0].texts[0].convertToTable("\t","\r");
Brett
Copy link to clipboard
Copied
Thanks for Response....
Your Code is working if we have proper text with tabs & new line Characters.
But, my text is:-
"Table 10-1This is an Example of a Table TitleThis is a Table Subtitle 1. Lorem ipsum dolor amet consectetuer adipiscing option 2. Elit sed diam nonummy nibh magna suscipit euismod tincidunt ut laoreet dolore 3. Duis autem vel eum dolor in hendrerit a. In vulputate velit esse consequat duis dolore* b. Facilisi vel illum dolore eu feugiat 4. Nulla facilisis at vero eros et accumsan et iusto odio dignissim 5. Qui blandit praesent luptatum zzril augue duis dolore te feugait nulla delenit augue enim ad minim a. Consectetuer adipiscing nonummy nibh euismod b. Tincidunt ut laoreet dolore magna consectetuer adipiscing aliquam erat volutpat 6. Nisl ut aliquip vel eum iriure dolor placerat facer ipsum in vulputate hendrerit velit iusto odio dignissim qui blandit*Et accumsan et iusto odio nibh euismod tincidunt laoreet dolore magna aliquam erat."
==========>>:
I am getting above text, I am able to get tabs but unable to get new line or line breaking characters,
i.e. I am not getting Rows from this texts.
May you help me please.....
Thanks...
Copy link to clipboard
Copied
The first parameter of the convertToTable() method is what is used to identify where you want a different column.
The second parameter of the convertToTable() method is what is used to identify where you want a different row.
If you were to say convertToTable("," "\t")
You could have text that looked like this:
hello,I am in a new column Hello,I am on a new row
It's dependent on how your text is formatted as to how you want the table to create your rows and columns.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more