XType for Mac KEY_CMD not working


The XType command for CMD does not work. I am using a Mac and Catalina OS using the latest version of UI.Vision chrome.

${KEY_CMD+KEY_^} does not work at the moment. (where ^ is any letter that pertains to a Mac related command)

I tried the Demo XType macro on both browser and desktop and the same issue is encountered. No error is displayed but CMD+S is not executed.

I tried clicking on a text field, typing a random string via XType (which was executed OK) and followed by:

XType | ${KEY_CMD+KEY_S}

The result is it just adds ‘S’ at the end of the string which I previously typed.

Same happens if I use XType | ${KEY_CMD+KEY_F} – ‘f’ is just appended at the end of the string.

Note: I have tried the KEY_META as well but to no avail.

Please send help!

Demo XType log:
[status] Playing macro DemoXType
[info] Executing: | store | medium | !replayspeed |
[info] Executing: | comment | Make sure the browser is in the foreground, so it receives the XTYPE keystrokes | |
[info] Executing: | bringBrowserToForeground | | |
[info] Executing: | open | https://ui.vision/demo/xtype | |
[info] Executing: | comment | To save the page, open the browser save dialog with a shortcut | |
[info] Executing: | if_v2 | {!os}=="mac" | | [info] Executing: | comment | Save web page in macOS is CMD+S | | [info] Executing: | XType | {KEY_CMD+KEY_S} | |
[info] Executing: | else | | |
[info] Executing: | comment | Generate today’s date and time | |
[info] Executing: | executeScript_Sandbox | var d= new Date(); var m=((d.getMonth()+1)<10)?‘0’+(d.getMonth()+1):(d.getMonth()+1); m = d.getFullYear()+"-"+m+"-"+d.getDate(); return m | mydate |
[info] Executing: | executeScript_Sandbox | return new Date().getHours()+"-" + new Date().getMinutes() + “-” + new Date().getSeconds() | mytime |
[info] Executing: | echo | Today is {mydate}, and the time is {mytime} | blue |
[echo] Today is 2020-04-9, and the time is 15-15-0
[info] Executing: | comment | Wait for the dialog to appear before sending the next keystrokes | |
[info] Executing: | pause | 2000 | |
[info] Executing: | comment | Send the new file name to the dialog and press ENTER | blue |
[info] Executing: | XType | Page_saved_by_UiVision_{mydate}_{mytime} | |
[info] Executing: | XType | ${KEY_ENTER} | |
[info] Mcro completed (Runtime 11.08s)

Thanks for the report. We confirmed the issue and are working on it.

Workaround: Use XRun and Python sendkeys, see I really need spacebar to work with XType or otherwise

Can you please retest? We tested on the latest version of MacOS Catalina and all works now:

What has changed:

  • macOS Catalina 10.15.5/10.15.6
  • We released a new installer with signed Mac installation files (make sure to download the new version of the installer (V2020-8 or later).

To test, you can simply run the Demo-XType macro. It sends CMD+S to open the Save dialog, and then presses the ENTER key:

I am using Mojave with the latest installation files V2020-9 and can verify the Demo-XType macro works as expected. However, if I try a macro in another app like Notes, KEY_CMD does not work. For example {KEY_CMD+KEY_A} should select all, but it simple adds an "a", and {KEY_CMD+KEY_N} should add a new note, but it simply adds an “n”.

The new XModule V2021-1 fixes this issue.