Sinnce this is really a scripting question, and it's had no response in the general forum, I'm moving it to the scripting forum.
There's a mixup going on here. Let's see if we can sort out some of it
If you just want to add new text to an already existing text frame,
myTextFrame.contents += "Hello";
But if you want the new text to have unique formatting, it's a little
There are two simple ways to do it, I think:
1. Create a temporary text frame, as you have done, and add the text,
and format everything in there. Then move() that formatted text to the
end of myTextFrame and delete the temporary frame:
tempFrame = app.activeDocument.textFrames.add();
tempFrame.contents = "New Text";
tempFrame.paragraphs.appliedFont = app.fonts.itemByName("Times New
Roman"); // etc...
2. The other option, is to add the text directly to your textFrame. But
if you want to format only that text, you have to store where the text
myTextFrame = app.selection;
firstInsertionPoint = myTextFrame.insertionPoints[-1].index;
myTextFrame.contents += "New Text";
myAddedText.appliedFont = app.fonts.itemByName("Trajan Pro"); // etc.
What you've done in your sample script, however, is to try to apply a
it, it won't throw an error either, because in fact you've created a new
property of your string. (myString = "Hello"; myString.appliedFont =
but that's nothing to do with InDesign!)