@Obi-wan – how is your sample composed?
I mean the word file of the three paragraphs.
Or did you copy/paste paragraph one two times in InDesign to get a longer story you could test with?
(on paragraph one the script is working fine, on paragraphs two and three something goes wrong)
@Mark-Anthony – Did not have time testing your script. Will do later…
Uwe