Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Update Indesign DOM after inserting text

Return to Member Forum

  • Author
    Posts
    • #1231575
      Anonymous
      Inactive

      Hi,

      is there a way to update the indices of the characters after inserting text to frame?

      for example:

      textFrame.texts[0].length //27
      content1.duplicate(LocationOptions.AT_END, textFrame);
      textFrame.texts[0].length //still 27
      content2.duplicate(LocationOptions.AT_END, textFrame);//LocationOptions.AT_END is now pointing to the wrong index

    • #12343160

      Hi Felix,

      Not sure what content1 and content2 are in your case.
      A script like following worked fine for me:

      var textFrame = app.selection[0];

      alert(textFrame.texts[0].length); // 5
      textFrame.texts[0].duplicate(LocationOptions.AT_END, textFrame);
      alert(textFrame.texts[0].length); // 10

      Regards,
      MT

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads