ExtendScript Table Object Bug
Rick Quatro
rick at rickquatro.com
Sat May 14 06:42:15 PDT 2011
Hello All,
I discovered a bug in FrameMaker 10's ExtendScript implementation. If anyone
can verify this, please let me know.
Summary: When you loop through the tables in the document, the ObjectValid()
function returns true for each table as expected. However, when you get a
list of tables using GetText(), the ObjectValid() function returns false for
each table. This is a problem, because child objects of the table also
return false. This is a serious problem because you can't, for example, loop
through all of the cells in the table, because ObjectValid() is false for
each cell.
Here is an example that illustrates the problem. Open a new FrameMaker
document and insert 2 or 3 tables in the main flow. Then run the code below
and look at the JavaScript Console.
var doc = app.ActiveDoc;
// Loop through all of the tables in the document.
var tbl = doc.FirstTblInDoc;
while (tbl.ObjectValid()) {
$.writeln("Loop through doc tables: " + tbl.ObjectValid());
tbl = tbl.NextTblInDoc;
}
// Get a list of tables in the document's main flow.
var flow = doc.MainFlowInDoc;
var textItems = flow.GetText(Constants.FTI_TblAnchor);
for (var i = 0; i < textItems.len; i += 1) {
tbl = textItems[i].obj;
$.writeln("Loop through main flow tables: " + tbl.ObjectValid());
}
Rick Quatro
Carmen Publishing Inc.
585-659-8267
rick at frameexpert.com
FrameMaker 10 ExtendScript eSeminar
May 26, 2011, 10:00 AM Pacific
http://www.adobe.com/cfusion/event/index.cfm?event=detail&id=1751822&loc=en_
us
More information about the framers
mailing list