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

Re: How to access a table for changes

$
0
0

Here's the working code I ended up using to search through a table and find out if it had any changebars.

 

Mark

 

// Find a changebar in tables. The context is iterating through the Pgfs in a doc.
function findChangebarInTable(pgf) {
    var tableitems = pgf.GetText(Constants.FTI_TblAnchor);
    // If no table anchors, return now.
    if (tableitems.length == 0) { return; }
    for (var i = 0; i < tableitems.length ; i += 1) {
        // get table using table anchor.
        var table = tableitems[i].obj;
        cellChangebar = searchCells(table);
        // If there's a changebar in any table, return.
        if (cellChangebar) {
            return true;
        }
    }
}

 

 

// Search the cells of the table for a changebar.

function searchCells(table) {

    var tcell = table.FirstRowInTbl.FirstCellInRow;

    while (tcell.ObjectValid()) {

        // Get changed items in this cell.

        var cellitems = tcell.GetText(Constants.FTI_CharPropsChange);

        for (var i=0; i < cellitems.len ; i +=1) {

            // Find out if the Cell has a changebar.

            // The result of the bitwise AND (&) must be greater than 0 or no changebar.

            var c = cellitems[i].idata & Constants.FTF_CHANGEBAR;

            if (c > 0) {

                return true;

            }

        }

        tcell = tcell.NextCellInTbl;

    }

}


Viewing all articles
Browse latest Browse all 3715

Trending Articles