the cell's overflow to find table - problem with script

Hello

as a translation company, we often do some DTP on Framemaker documents. Documents often contain many tables and the translated text will always enters the cells, giving overflow. I'm looking by creating a script that detects the overflow in the table cells.

I already tested a few scripts and met today with a problem that I can't find. I started detecting overflow from the cells in a selected table, that works very well and gives an alert when an overflow is detected. This script:

// == WORKS ON SELECTED TABLE ==
var doc = app.ActiveDoc;  
var tbl = doc.SelectedTbl;  
var row = tbl.FirstRowInTbl;  
var cell;  
  
while (row.ObjectValid () === 1) {  
    cell = row.FirstCellInRow;  
    while (cell.ObjectValid () === 1)  {  
     if (cell.Overflowed === 1) {  
  alert("cell overflow Will Robinson!");
  }
        cell = cell.NextCellInRow;  
    }  
    row = row.NextRowInTbl;  
}  
// == END OF WORKS ON SELECTED TABLE ==

However, I thought it would be nice to browse tables in a document and find all the cells of overflows, instead of going to table by table. If this script runs successfully in tables, lines and cells in a document:

// === LOOPS THROUGH TABLE, NO OVERFLOW ===
var doc = app.ActiveDoc;
var tbl = app.ActiveDoc.FirstTblInDoc;
var row = tbl.FirstRowInTbl;
var cell;


while (tbl.ObjectValid()) {
  alert ("gimme a table");
  while (row.ObjectValid () === 1) {
  cell = row.FirstCellInRow;  
  while (cell.ObjectValid () === 1)  {  
  alert("gimme a cell");
  cell = cell.NextCellInRow;
  }
  row = row.NextRowInTbl;
  }
tbl = tbl.NextTblInDoc;  
}    
// === END OF LOOPS THROUGH TABLE, NO OVERFLOW ===

When I add the block

    while (cell.ObjectValid () === 1)  {  
     if (cell.Overflowed === 1) {  
  alert("cell overflow Will Robinson!");

in this script, it does not work. According to the cell. Overwhelmed A requires the table to be selected? Does anyone know how to get around this problem - by selecting the table if the object is valid before performing a loop on the lines, or by the detection cell. A swamped in the above script?

I also - why not :) - I tried overflow under the doc.flow rather than FirstTbl, but although it detects flowes/frameworks and subcol correctly, it is not always register the overflow.

var doc = app.ActiveDoc
var flow = doc.FirstFlowInDoc
var frame = flow.FirstTextFrameInFlow
var subcol =frame.FirstSubCol

while (flow.ObjectValid()){        
            while (frame.ObjectValid()) {               
                    while (subcol.ObjectValid()){
                        if (subcol.OverFlowed === 1){
                        alert("colsies"); //doesn't work!
                        }
                        subcol = subcol.NextSubCol
                        }
                frame = frame.NextTextFrameInFlow
                }
            flow = flow.NextFlowInDoc
   }

I'm clearly missing something, but I can't know what? Any help would be greatly appreciated...

Kind regards

Geert

Your code in the second script isn't quite right. Try this:

var doc, tbl, row, cell;

doc = app.ActiveDoc;
tbl = doc.FirstTblInDoc;
while (tbl.ObjectValid ()) {
    row = tbl.FirstRowInTbl;
    while (row.ObjectValid ()) {
        cell = row.FirstCellInRow;
        while (cell.ObjectValid ()) {
            if (cell.Overflowed === 1) {
                alert ("Cell overflowed");
            }
            cell = cell.NextCellInRow;
        }
        row = row.NextRowInTbl;
    }
    tbl = tbl.NextTblInDoc;
}

Tags: Adobe FrameMaker

Similar Questions

Maybe you are looking for

  • latest updates changed my home page to pages I hate im getting fed up

    Until the 2 latest updates, I liked Firefox & has never had a single problem, I was happy for the years...Now, I'm afraid of updates & turn down them because Firefox has started to change my home page & etc, forcing me to waste configuration & restor

  • scroll bar

    The vertical scroll bar on the right side of the screen disappears when the web site I visit is short enough to not to require a scroll bar (i.e. is there no need to scroll upwards or downwards, because everything fits on one screen). If I move to an

  • Windows Vista crashes due to the update of windows

    I just reinstalled Windows Vista 32 bit on my Lenovo PC after experiencing problems due to a virus. However, during the execution of that Windows update, I started noticing problems because my computer would freeze randomly. Neither the mouse nor key

  • I LOST MY CD OF INTALLED MY PRINTER WHERE CAN I GET THIS IMFORMATION ON HP

    I need help to connect my printer to my deskpc window 7, I lost my cd of intalled my hp deskjet f4580 wireless printing, scanning, copying, if I can get this imformation on the web

  • "Documents.Library - ms" is no longer.

    I agree with the fix, but why is this happening again and again. Whenever I'm in the library, the same message. Fix once it should be enough. Someone knows why this error occurs?