How to fill the active field.

How would I populate the current active field with text from the clipboard? When I run the script below focus is lost from the active field. Depending on the field, control + tab does not always work to re-select the field either.

set theText to the clipboard
tell application "System Events"
	keystroke theText
end tell

Working example (assuming that you have open some text document and have clicked insert point in it initially. And you have some text in the clipboard):


set theText to the clipboard
tell application "TextEdit" to activate

tell application "System Events"
	keystroke theText
end tell

tell application "TextEdit" to activate

NOTE: WITH MODAL WINDOWS THIS IS IMPOSSIBLE (as with standard display dialog window of AppleScript).