Applescript, Windows 10, Parallels 14, and modifier keys

Discussion in 'Windows Virtual Machine' started by LennartL, Jun 8, 2019.

  1. LennartL

    LennartL Bit poster

    Messages:
    1
    For whatever reason parallels doesn't seem to send any modifier keys to windows when I use applescript. I've tried the following ways to create "š" into notepad but all will produce "s" instead of "š" (alt/option + s). What am I doing wrong? The script works perfect inside MacOS but modifier keys seem to get ignored by parallels. The results are the same when I try to use shift instead to create "S" not "s". The point to making it work is to then create applescripts for elgato stream deck (or any similar launcher) for weird symbols like μ or × and have them work in both MacOS and Windows applications.
    ---------
    tell application "System Events"
    key down option
    key code 1
    key up option
    end tell
    ---------
    tell application "System Events"
    keystroke "š"
    end tell
    ---------
    tell application "System Events"
    key code 1 using option down
    end tell
    --------
     
  2. luckman212

    luckman212 Bit poster

    Messages:
    9
    I came here with the same question/problem. Can anyone help? I have the example test Applescript below:

    tell application "Parallels Desktop" to activate
    tell application "System Events"
    key code 38 using {shift down} -- should type "J"
    key code 49 -- types a space
    keystroke "aA bB ;:" -- some test strings
    end tell

    Try opening a blank Notepad window in your Parallels VM and then running the script above. It will fail to type any of the SHIFTed characters. You'll get just lowercase equivalents. I have messed around with all the "gaming optimization" modes/settings as well as the overall global "send macOS System Shortcuts" changing from Auto to Always etc, but none of that helps.

    This script works fine in a VMware Fusion VM, so this is something about Parallels that is not passing the modifiers through correctly.
     

Share This Page