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

Re: Best way to copy range of paragraphs

$
0
0

Thanks for saving me 13 lines of code Jang. I am also going to try out your other suggestions for elegance. Here's the trimmed-down code:

 

function pasteChanges(doc, changePgf) {

    // Select paragraph with changebar.

    var tBegin = new TextLoc(changePgf, 0);

    var tEnd = new TextLoc(changePgf, Constants.FV_OBJ_END_OFFSET);

    var chgRange = new TextRange(tBegin, tEnd);

    doc.TextSelection = chgRange;

    doc.Copy();

 

    // Get the changes doc ready, and paste the changebar pgf into it.

    var firstChgPgf = changesDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

    var changesTloc = new TextLoc(firstChgPgf, Constants.FV_OBJ_END_OFFSET);

    var changesTRange = new TextRange(changesTloc, changesTloc);

    changesDoc.TextSelection = changesTRange;

    changesDoc.Paste();

}

 

But I just tested and my code does not find changebars in tables that are in the Pgf objects I am looping through. How do I catch these? I figure I have to additionally look for table anchors and then if I find one, loop through all the cells of that table.


Viewing all articles
Browse latest Browse all 3715

Trending Articles



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