I’m doing some automation in google drive and it uses the period as a shortcut key that I’d like to use. I tried using the xType variables {KEY_PERIOD} and {KEY_PER} and ${KEY_PRD} to no avail. I didn’t see these characters in user manual. Does anyone know how to xtype them?
Do you have a test page for this?
Maybe the simply way of sending characters works:
-
XClick
… to get the focus on the right part -
XType | .
<= just a dot!
The {KEY_…} logic is only needed if the web page or app needs explicit keyboard presses.
Thanks for your response. I tried the XType | . and it doesn’t work. It’s a shortcut so I think it needs to hardcode the period with the ${KEY_…} logic for it to register the shortcut
Here’s the list of google drive keyboard shortcuts showing some symbols like period and slash
I agree. This is interesting.
For a workaround: Do you use Win, Mac or Linux?
Thanks. I use windows
One way is to use SendKeys in PowerShell:
#Add for SendKeys
Add-Type -AssemblyName System.Windows.Forms
#Send the period
[System.Windows.Forms.SendKeys]::SendWait("(.)")
or Python or VBS: XType can't hold-down modifier keys [Workaround available]
Ok so is this what it would look like?
{
“Name”: “ps”,
“CreationDate”: “2020-10-15”,
“Commands”: [
{
“Command”: “XRun”,
“Target”: “powershell.exe”,
“Value”: “#Add for SendKeys Add-Type -AssemblyName System.Windows.Forms #Send the period [System.Windows.Forms.SendKeys]::SendWait("(.)")”
}
]
}
or do I have to tell it to execute a file in which this code resides?
Yes, you have to execute the .ps1 script itself from the macro