scripting text boxes and variables

How do I display variables in a text box that was created through a script.

I know how to make a text box in script: $gameMessage.add("Text")

But I don't know how to add game data in there.

I want something like this: $gameMessage.add("Character index: " + $gameActors.actor(1).index())

I think I need to somehow convert the result of $gameActors.actor(1).index() into a string before its use in the gameMessage.
try

"Character index: " & $gameActors.actor(1).index()use

String($gameActors.actor(1).index())to convert to string.
Thank you for the help. 

The & didn't work, but converting to a String did.

Note that if you convert to string, you need to use the plus sighn to add it into the message.

$gameMessage.add("Character index: " + String($gameActors.actor(1).index()))

$gameMessage.add(String($gameActors.actor(1).index()))

works as well

Original thread: https://forums.rpgmakerweb.com/threads/scripting-text-boxes-and-variables.54642/