<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi Rick,<BR>
 <BR>
Yes, I can confirm this bug. ObjectValid() is false when returned via GetText().<BR>
 <BR>
A workaround is to replace:    <BR>
tbl = textItems[i].obj;<BR><BR>
with:<BR>
tbl = doc.GetUniqueObject(Constants.FO_Tbl, textItems[i].obj.Unique);<BR><BR>
HTH,<BR>
Mike Pearson<BR>
<BR> <BR>
> From: rick@rickquatro.com<BR>> To: framers@lists.frameusers.com<BR>> Subject: ExtendScript Table Object Bug<BR>> Date: Sat, 14 May 2011 09:42:15 -0400<BR>> <BR>> Hello All,<BR>> <BR>> I discovered a bug in FrameMaker 10's ExtendScript implementation. If anyone<BR>> can verify this, please let me know.<BR>> <BR>> Summary: When you loop through the tables in the document, the ObjectValid()<BR>> function returns true for each table as expected. However, when you get a<BR>> list of tables using GetText(), the ObjectValid() function returns false for<BR>> each table. This is a problem, because child objects of the table also<BR>> return false. This is a serious problem because you can't, for example, loop<BR>> through all of the cells in the table, because ObjectValid() is false for<BR>> each cell.<BR>> <BR>> Here is an example that illustrates the problem. Open a new FrameMaker<BR>> document and insert 2 or 3 tables in the main flow. Then run the code below<BR>> and look at the JavaScript Console.<BR>> <BR>> var doc = app.ActiveDoc;<BR>> <BR>> // Loop through all of the tables in the document.<BR>> var tbl = doc.FirstTblInDoc;<BR>> while (tbl.ObjectValid()) {<BR>> $.writeln("Loop through doc tables: " + tbl.ObjectValid());<BR>> tbl = tbl.NextTblInDoc;<BR>> } <BR>> <BR>> // Get a list of tables in the document's main flow.<BR>> var flow = doc.MainFlowInDoc;<BR>> var textItems = flow.GetText(Constants.FTI_TblAnchor);<BR>> for (var i = 0; i < textItems.len; i += 1) {<BR>> tbl = textItems[i].obj;<BR>> $.writeln("Loop through main flow tables: " + tbl.ObjectValid());<BR>> }<BR>> <BR>> Rick Quatro<BR>> Carmen Publishing Inc.<BR>> 585-659-8267<BR>> rick@frameexpert.com<BR>> <BR>> FrameMaker 10 ExtendScript eSeminar<BR>> May 26, 2011, 10:00 AM Pacific<BR>> http://www.adobe.com/cfusion/event/index.cfm?event=detail&id=1751822&loc=en_<BR>> us<BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> _______________________________________________<BR>> <BR>> <BR>> You are currently subscribed to framers as mt_pearson@hotmail.com.<BR>> <BR>> Send list messages to framers@lists.frameusers.com.<BR>> <BR>> To unsubscribe send a blank email to<BR>> framers-unsubscribe@lists.frameusers.com<BR>> or visit http://lists.frameusers.com/mailman/options/framers/mt_pearson%40hotmail.com<BR>> <BR>> Send administrative questions to listadmin@frameusers.com. Visit<BR>> http://www.frameusers.com/ for more resources and info.<BR>                                         </body>
</html>