Also worth mentioning: A different approach would be to duplicate the textFrame you want to get information of. Parts of a threaded table would be duplicated with it as a new table not threaded. *Now* you can tell, if the textFrame has a table from the dup.
var myDupTextFrame = myTextFrame.duplicate();
If the original text frame is anchored (its parent is a character) or if it is threaded to an anchored text frame, you have to move the duplicate to the position of the original one.
var myTextFrame = app.selection[0]; var myProperties = myTextFrame.properties; myTextFrame.duplicate().properties = { geometricBounds:myProperties.geometricBounds, fillColor:"Magenta" /*etc.*/ };
Uwe