0 Replies Latest reply on Jan 20, 2011 7:26 PM by leox2

    CS5: convertToTable() works only partially




      I am working with a CS 5 script that is used to import an Excel table into InDesign and format the table to my specific needs.
      I first copy the relevant cells from Excel to the clipboard and paste them directly into the InDesign document. This creates a text area which I then select and run my script:


          var myText = app.activeDocument.selection[0].texts[0];
          var myTable = myText.convertToTable();


      This works to some extent on small tables. But tables with a lot of cells (roughly more than 900) are proceesed only partially. The table then just ends in the middle and the rest of the text is left untouched. This happens only with big tables and always after the same number of cells for a specific table.


      It also looks like convertToTable() is not just returning a table but changing the original text object. When I export the object "myText" as a TAGGED_TEXT file it is well visible that the original text was only converted partially to a table and suddenly the table stops with the <TableEnd:> tag and the rest of data is left untouched.


      When I do the table conversion step manually by selecting everything in the textarea and using "Table" -> "Convert Text to Table..." everything works fine and the whole table is converted.


      What is the difference between executing this manually from the menu and calling convertToTable()? Is this an issue of insufficient memory?


      Thanks in advance.