Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

How to insert a new paragraph?

$
0
0

I want to insert a paragraph with something like a line, to separate hunks of text I am pasting into a document. I see no obvious way to do this. I see no AddPgf() function, for example. And no Doc.AddPgf() or whatever.

 

I can add text in an existing paragraph with this:

 

function test1() {

var doc = app.ActiveDoc;

var t1 = new TextLoc();

var firstPgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

t1.obj = firstPgf;

t1.offset = 0;

doc.AddText (t1, "Hello");

}

 

I had the idea that I would do AddText() at the very end of a paragraph to create a new paragraph, but this code crashes FrameMaker (only difference from above is Constants.FV_OBJ_END_OFFSET):

 

function test1() {

var doc = app.ActiveDoc;

var t1 = new TextLoc();

var firstPgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

t1.obj = firstPgf;

t1.offset = Constants.FV_OBJ_END_OFFSET;

doc.AddText (t1, "Hello");

}

 

Thanks,

Mark


Viewing all articles
Browse latest Browse all 3715

Trending Articles



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