Skip to main content
K.Daube
Community Expert
Community Expert
March 3, 2021
Answered

How to get information from a found marker?

  • March 3, 2021
  • 1 reply
  • 530 views

Dear Friends, experts and gurus!

To inspect markers I want to combine "Search for any Marker" and "Display Marker contents".

When a marker is found (by the Find method), i have a Text Range within a paragraph.

oTR.obj is Pfg

oTR.end.offset - oTR.beg.offset is 1 (the marker 'length').

But this is some sort of a dead end. I have no clue how to find out any useful information about the marker.

→ How to find through the maze of objects to the marker?

It may be that this is not possible at all with ExtendScript - and I need the approach via loop through all markers in the document (and visusalise them).

This topic has been closed for replies.
Correct answer Klaus Göbel

Hello Klaus,

your find result is a textrange.

Now you only have to this to get all markers in this pgf:

 

  var Markers = oDoc.GetTextForRange (oTR, Constants.FTI_MarkerAnchor);
    var FoundMarkers = [];        
          
  
    for (var x = 0; x < Markers.length; x++)
        {
        var oTextItem = Markers[x];
        FoundMarkers.push(oTextItem.obj)
        }

 

 

1 reply

Klaus Göbel
Klaus GöbelCorrect answer
Legend
March 3, 2021

Hello Klaus,

your find result is a textrange.

Now you only have to this to get all markers in this pgf:

 

  var Markers = oDoc.GetTextForRange (oTR, Constants.FTI_MarkerAnchor);
    var FoundMarkers = [];        
          
  
    for (var x = 0; x < Markers.length; x++)
        {
        var oTextItem = Markers[x];
        FoundMarkers.push(oTextItem.obj)
        }

 

 

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
March 3, 2021

To the initiated many mysteries doe not exist.