how can I use applescript to type? how can I use applescript to type in a specified area on the screen? I've tried the 'keystroke' command, but it doesn't seem to work. also, how can I use applescript to display an image? thanks a lot if you answer. here's the code I have so far:

set theText to text returned of (display dialog "Put what you want to autotype here." default answer "" buttons {"OK", "cancel"} default button 1)
display dialog "select where you want me to type " &amp; theText &amp; " Your text will be typed in the area selected. you have 10 seconds to select once you click 'OK'" buttons {"OK"}
delay 10
say "typing"
--command for typing here
end
end
end
tell application &quot;System Events&quot;
    set textToType to &quot;text here&quot;
    keystroke textToType
end tell

Replace within the quotes of &quot;text here&quot; to what ever you need.