How to use Applescript to type in a application?
You need to use System Events to send the keystrokes not the app, try something like this:
on run {}
    tell application &quot;My Application&quot; to activate
    set str to &quot;string&quot;
    repeat
        tell application &quot;System Events&quot; to keystroke str
        tell application &quot;System Events&quot; to keystroke return
        delay (random number from 5.0 to 10.0)
    end repeat
end run