I am working on an Applescript to paste what was last copied to any current field. It is to be used with VoiceOver and the key code way (only way I know how) does not work all of the time.
tell application "System Events" to key code 9 using command down
say "paste"
I use keystroke:
tell application "System Events" to keystroke "v" using command down
I'm not aware of an error you should get, so you'll have to share.