Skip to main content
K.Daube
Community Expert
Community Expert
Mar 3, 2021 10:16 AM UTC
Answered

How to get information from a found marker?

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 is closed to new replies. Start a new post to keep the conversation going.
Klaus Göbel
Klaus GöbelCorrect answer
Legend
Mar 3, 2021 10:51 AM UTC

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)
        }

 

 

2 replies

Klaus Göbel
Klaus GöbelCorrect answer
Legend
Mar 3, 2021 10:51 AM UTC

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)
        }

 

 

Translate
K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
Mar 3, 2021 2:36 PM UTC

To the initiated many mysteries doe not exist.

Translate