"guiText" equivalent for TextMesh

In a script I can use the shortcut guiText to refer to the GUIText component attached to the object, but what’s the equivalent for a TextMesh?

There is no direct shortcut to a TextMesh component. You need to use GetComponent to access it.

TextMesh textMesh = gameObject.GetComponent<TextMesh>();
textMesh.text = "Hi there!";