I need expert advice on above issue. It will appreciate if anyone help here.
It all depends on the way you're targeting a parent:
text.parent(Story).parent ==> Document
text.parentTextFrames(textFrame).parent ==> could be a Group if grouped.
Be aware that text.parentTextFrames will throw an error if text is hidden (overflowing).
Thanks Jerek, it worked!