TextRange - SubCol
Hello,
I'm using template with 2 or 3 column textframe.
I'm trying to make a script that avoid hyphen at end of column.
Getting the last pgf of a column, getting the end of line type is not a problem (Constants.FTI_LineEnd).
To check if a pgf is on both column, i'm looping through my pgf to find when the textrange, i'm using, change of column.
I can only get the Id Column from the start of the pgf (pgf.InTextObj.Unique - InTextObj is a SubCol).
Is there a way to know on which column my textrange is?
var vCurrentDoc=app.ActiveDoc;
// go to last pgf of column
var pgf = vCurrentDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstSubCol.LastPgf;
// select the pgf
var textRange = new TextRange();
textRange.beg.obj = pgf;
textRange.beg.offset = 0;
textRange.end.obj = pgf;
textRange.end.offset = Constants.FTI_LineEnd;
var textItems = vCurrentDoc.GetTextForRange(textRange, Constants.FTI_String);
if(textItems.length > 0){
vCurrentDoc.TextSelection = textRange;
var vLineEnd = pgf.GetText(Constants.FTI_LineEnd);
var vOriginalLine = vLineEnd.len;
var CheckRange = new TextRange();
var vCheck = 0;
// to get the Id column of the pgf
var vColNum = pgf.InTextObj.Unique;
// no need to check last end of line = end of pgf => vOriginalLine-1
while (vCheck < vOriginalLine-1) {
CheckRange.beg.obj = pgf;
CheckRange.beg.offset = (vLineEnd[vCheck].offset)-1;
CheckRange.end.obj = pgf;
CheckRange.end.offset = vLineEnd[vCheck].offset;
vCurrentDoc.TextSelection = CheckRange;
// HERE is WHEREI'M STUCK
var vColNumTR = ?????????;
// check fi column change
if (vColNum != vColNumTR){
// process
}
vCheck = vCheck +1;
}
vCurrentDoc.TextSelection = textRange;
}
....
Thanks in advance for the help

