Answered
Get the first character in a textitem
I'm looping through the paragraphs in a document, checking for a paragraph name, then I want to check if each new line (other than the first) starts with a specified character, if it does then I'll do other stuff, but I'm feeling dense and can't figure out how to get the first character based on what I have below.
var doc = app.ActiveDoc;
var pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
while(pgf.ObjectValid() === 1) {
if (pgf.Name === 'SomePgf') {
var textList = pgf.GetText(Constants.FTI_LineBegin);
for (var i = 1; i < textList.length; i++) {
// how do i get the first character of what is in the text item?
}
}
pgf = pgf.NextPgfInFlow;
}
I greatly appreciate any help.
