Hi Jang,
Thank you for your response and for the suggestions!
Unfortunately, nothing changes when using oDoc.Clear (Constants.FF_VISIBLE_ONLY). When oDoc.TextSelection = oTRange, the script crashes consistently. If I replace oDoc.TextSelection with "oRange" defined earlier, the script adds text strings consisting of "x" but does not delete the original text.
In your previous post, you said: "So instead of using the TextSelection and then walk through all paragraphs in the document, I now use the proper method to select the first paragraph in the first text frame in the main flow and then walk through the linked list of paragraphs down to the end of the flow." Could you please demonstrate how you changed the script?
As a side note, I should say that the Adobe extendscript documentation is terrible and quite useless for a newbie like me. Many properties cannot be found, descriptions are not informative. Are you aware of any extendscript resource that provides more detailed information?
Thank you very much in advance!