ExtendScript Table Object Bug

Michael Pearson mt_pearson at hotmail.com
Sat May 14 07:21:46 PDT 2011


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: rick at rickquatro.com
> To: framers at lists.frameusers.com
> 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
> 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
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> 
> You are currently subscribed to framers as mt_pearson at hotmail.com.
> 
> Send list messages to framers at lists.frameusers.com.
> 
> To unsubscribe send a blank email to
> framers-unsubscribe at lists.frameusers.com
> or visit http://lists.frameusers.com/mailman/options/framers/mt_pearson%40hotmail.com
> 
> Send administrative questions to listadmin at frameusers.com. Visit
> http://www.frameusers.com/ for more resources and info.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frameusers.com/pipermail/framers-frameusers.com/attachments/20110514/3777c5b5/attachment.htm>


More information about the framers mailing list