Quantcast
Channel: Adobe Community : Unanswered Discussions - Adobe FrameMaker
Viewing all articles
Browse latest Browse all 5254

How to define the offset for a textrange (after a TAB)?

$
0
0

Dear experts,

I want to grab the part after TAB in a paragraph, for example from
Something TAB rest of the paragraph using some character formatting.
I have no clue how to find the value for the offset.

Converting the pgf to text and then look for the TAB will obviously provide a wrong value - or not?

Will it be necessary to iterate through the paragraph (moving the text range from char to char) to find the item behind the TAB?

Can You please enlighten me ?

var doc = app.ActiveDoc;
var mainflow = doc.MainFlowInDoc;
var tframe = mainflow.FirstTextFrameInFlow;
var pgf = tframe.FirstPgf;

GetPgfPartAfterTAB (pgf);

function GetPgfPartAfterTAB (oPgf) {
  var oDoc = app.ActiveDoc;  var tRange= new TextRange();  tRange.beg.obj = oPgf;  tRange.beg.offset = 0;           // Well, this must be calculated!  tRange.end.obj = oPgf;  tRange.end.offset = Constants.FV_OBJ_END_OFFSET;  oDoc.TextSelection = tRange;  oDoc.Copy (0);                  // for test
}

Viewing all articles
Browse latest Browse all 5254

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>