If you want to generate text using scripting, make sure you're working in grayscale or RGB mode. Below is a simple text creation method that requires positioning the text after it's generated since its size can't be determined beforehand. I hope this explanation proves useful.
createText("Tahoma-Regular", 36, 255, 0, 0, "Welcome", 200, 100)
activeDocument.activeLayer.name = "Title";
activeDocument.activeLayer.textItem.justification = Justification.CENTER
function createText(fontFace, fontSize, red, green, blue, content, posX, posY)
{
var newLayer = app.activeDocument.artLayers.add()
newLayer.kind = LayerKind.TEXT
var textColor = new SolidColor();
textColor.rgb.red = red;
textColor.rgb.green = green;
textColor.rgb.blue = blue;
var textRef = newLayer.textItem
textRef.font = fontFace;
textRef.contents = content;
textRef.color = textColor;
textRef.size = fontSize
textRef.position = new Array(posX, posY)
}