Try here - https://forums.adobe.com/community/framemaker/extendscript?view=overview
mdeg,
What do you mean by "range"? Do you mean a text range, and you want to know which range occurs before the other in the respective flow? If that's the case, I think you would need to do the following, assuming the ranges start in different paragraphs:
- Find the text frame for one of the paragraphs, likely with the InTextFrame property of the textrange.beg.obj object
- Get the parent flow object, likely with the textframe.Flow property
- Get the first paragraph in the flow, likely with flow.FirstTextFrameInFlow.FirstPgf
- Iterate over all paragraphs in the flow, likely with the pgf.NextPgfInFlow property
- The first one that you get to that matches one of your textrange.beg.obj objects means that textrange occurs first
If the two ranges start in the same paragraph, where textrange1.beg.obj = textrange2.beg.obj, you could just skip all that and compare the offsets.
If one or more of the ranges are in a table cell, footnote, etc, the whole process becomes significantly more complex. Too much to address here.
Russ