I've seen topics that refer to an alias called sendkeys
While I don't understand how it works, this is the one recently posted by Horstl
Code:
alias -l sendkeys { .comopen a WScript.Shell | .comclose a $com(a,SendKeys,3,*bstr,$$1-) }
Maybe he can explain how it works, or make other comments on it.

I had it working with a script, but due to losses occured due to hard drive crash, that was one of a few codes that I lost.