Quantcast
Channel: Adobe Community : Popular Discussions - Adobe FrameMaker
Viewing all articles
Browse latest Browse all 23442

Add paragraphs with text

$
0
0

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

t-write-array.png

// 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;  }

Viewing all articles
Browse latest Browse all 23442

Trending Articles



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