The question is quite confusing, are you refering to getting the content of a text file(.txt) or get information of an existing text in a boardfile?
If you are refering to an existing text on board file, you can use the following codes.
note: make sure that layer of thee text is active.
axlSetFindFilter(?enabled `("noALL" "text") ?onButtons `("noALL" "text"))
textDbid = car(axlGetSelSet())
variable textDbid contains all anfo of the text. You can noew use different attributes to extract whatever you need
Hope this helps