Home Apple applescript – osascript keystroke character case with VMware internet console

applescript – osascript keystroke character case with VMware internet console

0
applescript – osascript keystroke character case with VMware internet console

[ad_1]

Seeking to get the power to simulating typing a password right into a vm console. Figured osascript and keystroke ought to be the reply.

If I run the next I get what I consider to be the proper behaviour within the terminal.

#!/usr/bin/osascript
set UC to "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ"
set lc to "abcdefghijklmnopqrstuvwxyzåäö"

#inform utility "Safari" to activate
inform utility "System Occasions"
  repeat with c in (the clipboard)
    contemplating case
      if UC comprises c then
         key down shift
         keystroke "u" #c
         key up shift
      else
        keystroke "l" #c
      finish if
    finish contemplating
  finish repeat
finish inform

Consequence with stackEXCHANGE in clipboard:

➜  ~ ./send_keys.osa    
lllllUUUUUUUU%                                                                        ➜  ➜  ~  lllllUUUUUUUU

Including the inform to activate Safari I count on one thing much like find yourself in my VMware vm console terminal – nonetheless:

lc only

The context is efficiently switched to the Safari vm console window and the string is written appropriately besides all characters are decrease case. The key down shift and key up change which work tremendous in terminal (or in different internet sites I examined), does not work within the vm console.

How can I get keystroke to ship characters within the right case to the vm console? (Or – is there one other solution to get the string into the vm console?)

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here