• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Range comparison

New Here ,
Sep 16, 2014 Sep 16, 2014

Copy link to clipboard

Copied

Hi all,

I'm new in FDK and try to compare two ranges to define which of them is the first one in the document. But I didn't find any function in FDK.

Does anybody know ways to do it?

TOPICS
Scripting

Views

388

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Sep 17, 2014 Sep 17, 2014

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.Fir

...

Votes

Translate

Translate
Community Expert ,
Sep 16, 2014 Sep 16, 2014

Copy link to clipboard

Copied

Now why would you ask in the unstructured FM forum when there’s a whole forum devoted to Scripting?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 16, 2014 Sep 16, 2014

Copy link to clipboard

Copied

Hi Jeff,

sorry, but I don't understand your question. I wrote my question in the All communities -> Framemaker -> Discussions, how there is related to the scripting only?

And how my question is related to unstructured FM? I work with the structured mode.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2014 Sep 16, 2014

Copy link to clipboard

Copied

Try here - https://forums.adobe.com/community/framemaker/extendscript?view=overview

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 17, 2014 Sep 17, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2014 Sep 17, 2014

Copy link to clipboard

Copied

LATEST

Thank you Russ.

Your answer is quite enough to start the implementation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines