Hi Rick, Yes, I can confirm this bug. ObjectValid() is false when returned via GetText(). A workaround is to replace: tbl = textItems[i].obj;
with: tbl = doc.GetUniqueObject(Constants.FO_Tbl, textItems[i].obj.Unique); HTH, Mike Pearson > From: [email protected] > To: [email protected] > Subject: ExtendScript Table Object Bug > Date: Sat, 14 May 2011 09:42:15 -0400 > > 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 > [email protected] > > 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 > > > > > > > _______________________________________________ > > > You are currently subscribed to framers as [email protected]. > > Send list messages to [email protected]. > > To unsubscribe send a blank email to > [email protected] > or visit > http://lists.frameusers.com/mailman/options/framers/mt_pearson%40hotmail.com > > Send administrative questions to [email protected]. Visit > http://www.frameusers.com/ for more resources and info.
_______________________________________________ You are currently subscribed to framers as [email protected]. Send list messages to [email protected]. To unsubscribe send a blank email to [email protected] or visit http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com Send administrative questions to [email protected]. Visit http://www.frameusers.com/ for more resources and info.
