I have a Crossreference link to TextAnchor:
Ex: Display on Indesign: P15
If I get contents of TextFrame, it only is a special character.
if i get contents of character, it is a interger value: 1397781622
How can get value "P15"?
what is returned with that value is an enumeration for a special character.
In this case it is: SpecialCharacters.TEXT_VARIABLE
You could use the TextVariableInstance class and its property resultText to get what it is showing.
If the first TextVariableInstance is the one you like to address—there could be more—try the following:
var contentsOfSpecialCharacter = myTextFrame.textVariableInstances.resultText;