@Balaji – if "something" is nested inside of your rectangle, use the allPageItems array of that rectangle to detect this:
//Rectangle selected: var myRectangle = app.selection[0]; var allInRectangle = myRectangle.allPageItems; alert(allInRectangle.length);
A table is not part of a graphic.
It's part of a text frame or sits nested in a table cell.
Uwe