2 Replies Latest reply on Jan 19, 2010 3:02 AM by Harbs.

    Formatting text

    Techi Panda Level 2

      Hi scripters

       

      Here I am creating text frame and adding text. It works fine.

       

      var myCurrentParagraph = app.documents[0].selection[0].paragraphs[0];
      var myNextParagraph = myCurrentParagraph.insertionPoints[-1].paragraphs[0];

      captxt=myNextParagraph.contents.split('\r')[0];

      myCaption = myPicture.parent.textFrames.add ();
      myCaption.contents= captxt;
      myCaption.paragraphs[0].appliedParagraphStyle= "FC";
      myCaption.fit(FitOptions.frameToContent);

       

      Now whats my problem is while I am adding text into the added text frame I lost all the formatting from selected text. Is there any way to move the text into new text frame with formatting?

       

      thanks

       

      regards

      a r u l