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

Re: Applying a condition to a paragraph

$
0
0

Hi Russ, This may be more of a FrameMaker 10 ExtendScript issue. I just mocked up a sample document of almost 2000 pages and ran a modified version of Anchal's code. It took awhile, but it worked in FrameMaker 11.

 

#target framemaker

var doc = app.ActiveDoc

var tr = doc.TextSelection

var newFmt = doc.GetNamedCondFmt("Comment");

var props = doc.GetTextPropVal(tr.beg,Constants.FP_InCond);
props.propVal.isval[0] = newFmt.id;
props.propVal.osval[0] = newFmt;

var pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

while (pgf.ObjectValid()) {

    tr = new TextRange ();    tr.beg.obj = tr.end.obj = pgf;    tr.beg.offset = 0;    tr.end.offset = Constants.FV_OBJ_END_OFFSET;    doc.SetTextPropVal(tr, props);    pgf = pgf.NextPgfInFlow;
}

 

Rick


Viewing all articles
Browse latest Browse all 3715

Trending Articles