How to select text in script by "Type tool"?
On the picture the first variant is with the selected = true property applied, and the second variant - all characters are selected with the Type tool (this is what you need to do in the script).
p.s. a Text Frame 🙂