I really need spacebar to work with XType or otherwise (Workaround availabe)

KEY_SPACE for XType should be available in a few weeks. Meanwhile you can use use XRun as workaround..

Update: 2020/8/8: KEY_SPACE is now available. But this post is still worth reading because:

  • It shows how to use XRUN
  • The “external sendkeys” method shown below is still useful if you need to simulate some exotic keystroke combinations that are not supported out of the box by the RPA software.

XRUN and Sendkeys

Here is a Windows solution (Scroll down for Mac and Linux solutions):

With XRun you can call for example a VBS script with sendkeys " " (<- space!) inside:

Here we use the XRun command to run a VBS script with sendkeys inside. The screencast also shows the difference between sending text strings like XTYPE | abc and explicitly simulating keyboard key presses with XTYPE | {KEY_D}{KEY_E}

vbs sendkeys script:

' Start
Set WshShell = WScript.CreateObject("WScript.Shell")

' Type in Hello World
WshShell.SendKeys "Hello World!"
WshShell.SendKeys "{ENTER}"

test macro:

{
  "Name": "sendkeys with VBS",
  "CreationDate": "2020-2-24",
  "Commands": [
    {
      "Command": "open",
      "Target": "http://keyboardchecker.com/",
      "Value": ""
    },
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "slow",
      "Value": "!replayspeed"
    },
    {
      "Command": "XType",
      "Target": "ab c",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_D}${KEY_E}",
      "Value": ""
    },
    {
      "Command": "XRun",
      "Target": "c:\\test\\key.vbs",
      "Value": ""
    }
  ]
}

Mac and Linux Sendkey solutions

2 Likes