Hi Klaus,
just change your last line from
oDoc.NewSeriesPgf(pgf);
to :
pgf = oDoc.NewSeriesPgf(pgf);
that should do it.
So you directly point to the new pgf.
completely :
// 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
for (var i = 0; i < nItems; i += 1) {
textLoc = new TextLoc (pgf, 0);
insText = items[i];
oDoc.AddText (textLoc, insText + "\x08" + insText); // \t inserts a NL...
if (i < nItems -1){
pgf = oDoc.NewSeriesPgf(pgf); // add a paragraph
}
}