4 Replies Latest reply on Jan 11, 2017 3:51 AM by KlausFriese

    Embed Textframe in Textframe and add more content ..

    KlausFriese

      Hi,

       

      I'm currently working with textframes and I like to add inline textframes and more paragraphs.

      My problem: If I create an inline textframe and add more text to the content after that the inline textframe disappears.

       

      Example code:

       

      var content = "Paragraph\nLine 1\nLine 2\r";

      var doc = app.activeDocument;

      var tf1 = doc.pages[0].textFrames.add({geometricBounds: ['12.7mm','12.7mm','200mm', '200mm']}); 

      tf1.contents = content; 

           

      var insertRef = tf1.paragraphs[0].insertionPoints[-1];

      var tf2 = insertRef.textFrames.add(); 

         

      tf2.geometricBounds = [tf2.geometricBounds[0], tf2.geometricBounds[1], tf2.geometricBounds[2] + 50, '50mm']; 

      tf2.contents = content; 

       

      tf1.contents = tf1.contents + content;

       

      If I remove the last line I see the inline textframe - if I add it again, the inline textframe is gone. Any idea why this happens?

       

      Thanks

      Klaus