1 Reply Latest reply on Feb 24, 2015 10:19 PM by Laubender

    table.convertToText() issue

    Jump_Over Level 5

      Hi all,

       

      I am not sure if this was reported before (can not match any searches)

      For me looks like a bug or something weird, at least.

       

      Start point is to convert a table to text (even by 1-liner script) and to make undo after this.

      A table is back and ready to use in UI (to select, to modify contents) but not by script.

      Although table.isValid == true no other property works and script returns error "object no longer exists"

       

      Everything goes available if textFrame with this table is duplicated OR after reopening doc (save doesnt help - save, close and open - helps)

       

      Can someone confirm this on his side OR - even better - throw some light on this issue?

       

      (CS 5.0 and Windows 7)

       

      Jarek

        • 1. Re: table.convertToText() issue
          Laubender Adobe Community Professional & MVP

          @Jarek – I can see this as well.

          On Mac OSX 10.7.5 with InDesign CC 2014.2.

           

          One text frame with just one table is selected.

           

          $.writeln(app.selection[0].parentStory.tables.length);
          //1
          $.writeln(app.selection[0].parentStory.tables[0]);
          //[object Table]
          $.writeln(app.selection[0].parentStory.tables[0].getElements()[0]);
          //[object Table]
          

           

          Converted to text and then one undo will get you this:

           

          app.selection[0].parentStory.tables[0].convertToText("$","&");
          app.documents[0].undo();
          $.writeln(app.selection[0].parentStory.tables.length);
          //1
          $.writeln(app.selection[0].parentStory.tables[0]);
          //[object Table]
          $.writeln(app.selection[0].parentStory.tables[0].getElements()[0]);
          //[object ]
          //Error: Object is invalid
          

           

          I could even copy/pasted that text frame with the invalid table, duplicated it, and still, the table stays invalid.

           

          Exported to IDML, exported to IDMS.

          That finally crashed my InDesign:

           

          Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
          Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
          
          VM Regions Near 0:
          --> 
              __TEXT                 0000000108b12000-0000000108b18000 [   24K] r-x/rwx SM=COW  /Applications/Adobe InDesign CC 2014/Adobe InDesign CC 2014.app/Contents/MacOS/Adobe InDesign CC 2014
          
          Application Specific Information:
          objc[281]: garbage collection is OFF
          
          Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
          0   com.adobe.InDesign.Table Model    0x00000001172f4ab5 0x117268000 + 576181
          1   PublicLib.dylib                   0x000000010a083650 RepresentScriptProvider::AccessLabel(IDType<ScriptID_tag>, IScriptRequestData*, IScript*) + 688
          2   PublicLib.dylib                   0x000000010a084b7b RepresentScriptProvider::AccessProperty(IDType<ScriptID_tag>, IScriptRequestData*, IScript*) + 283
          3   com.adobe.InDesign.Table Model    0x00000001172f8a49 0x117268000 + 592457
          4   PublicLib.dylib                   0x000000010a07f039 CScriptProvider::AccessProperties(IScriptRequestData*, IScript*) + 489
          5   com.adobe.InDesign.Scripting      0x0000000117daeac7 0x117d7d000 + 203463
          6   com.adobe.InDesign.Scripting      0x0000000117daf0e9 0x117d7d000 + 205033
          7   com.adobe.InDesign.INXCore        0x00000001190dd0fa 0x1190c4000 + 102650
          8   PublicLib.dylib                   0x000000010a1ee656 CScriptDOMElement::GetMultipleAttributes(K2Vector<IDType<ScriptID_tag>, K2Allocator<IDType<ScriptID_tag> > > const&, adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 374
          9   PublicLib.dylib                   0x000000010a01b988 CTextScriptDOMElement::GetNonStyleAttributes(short, adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 680
          10  com.adobe.InDesign.INXCore        0x000000011910b057 0x1190c4000 + 290903
          11  PublicLib.dylib                   0x000000010a1eed92 CScriptDOMElement::GetAttributes(adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 194
          12  com.adobe.InDesign.INXCore        0x000000011911f4d3 0x1190c4000 + 373971
          

           

           

           

          Uwe