Windows – troubleshoot applescripted typing missing shift key and numerics in windows xp under parallels 8

applescriptkeyboardparallels-desktopwindows

I am using a Windows XP VM with Parallels 8 under Mountain Lion. I have a remote desktop connection from XP that does not allow pasting from the clipboard, but typing works, of course. I have an AppleScript simulating as if I typed the clipboard. However, the Shift key is not held down for modified keys, even though all keyboard layouts are in sync otherwise. Also curiously, numeric characters don't go through while "(" is turned into "9". See the full example below.

This happens in script-typing into XP desktop apps too, RDC only motivates why I cannot simply paste the clipboard. But this is a problem of scripted keystrokes in Parallels!

This only happens for this script and even only some keys with the script, the shift key is synchronized otherwise.

The remote connection is not super fast, but low speed did not break the use of the script in other cases (when I did not need the XP VM).

What is there to do?

This KB-article is about a similar shift-key issue from previous versions, even RDC-specific, but did not solve my problem:
http://kb.parallels.com/en/9129

Here is the script:

on run
    repeat with theItem in (the clipboard)
        tell application "System Events" to keystroke theItem
        delay 0.01
    end repeat
end run

This is what I tried to copy and paste (by scripted typing):

~!@#$%^&*()_+

QWERTYUIOP{}|

ASDFGHJKL:"

ZXCVBNM<>?

`1234567890-=

qwertyuiop[]\

asdfghjkl;'

zxcvbnm,./

This is what I got, see the messed-up order of rows, even, and even the cursor was before the x in last full-length line, not at the end — somehow it jumped to the beginning of a row before typing more.

`1234567*90-+

qwertyuiop[]\

asdfghjkl;'

-=

qwertyuiop[]\

asdfghjkl;'

zxcvbnm,/

xcvbnm,./

`

Best Answer

It's a problem that i have brought to their attention on multiple occasions. and as of right now, they still haven't even fixed the problem in v9 betas. so, if this is a deal breker for you (as it was for me), keep using parallels v7. it's the last one that they have that applescripting still works properly in.