Dear patient helpers,
I want to 'dump' the contents of an array into a series of paragraphs. Two problems appear in my script:
- inserting a TAB by \t inserts a NewLine
- items are not placed in succesive paragraphs but at the start of the flow - hence in reverse order and not in own paragraphs
// write array to multiple paragraphs var items = new Array (); var nItems, pgf, textLoc, oDoc; items = ["Århus", "Çedille", "Dandy"]; nItems = items.length; oDoc = app.ActiveDoc; pgf = oDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf; // get first pgf in flow textLoc = new TextLoc (pgf, 0); for (var i = 0; i < nItems; i += 1) { insText = items[i]; oDoc.AddText (textLoc, insText + "\t" + insText); // \t insert a NL... oDoc.NewSeriesObject(Constants.FO_Pgf, pgf); // add a paragraph pgf = oDoc.NextPgfInFlow; }