VBS - 带花括号的发送键

VBS - Sendkeys with curly braces

我正在尝试升级在高级脚本部分使用 VBS 的 Dragon Speech Recognition。但是使用 SendKeys 的行为很奇怪。我要发花括号:

SendKeys "{}}"

抛出错误,而

SendKeys "^%0"

完美运行。即使 SendKeys "{{}" 有效,但右大括号只能通过 Shift + Alt + 0.

完成

documentation clearly states {{}{}} 分别但是这行不通。我在这里遗漏了什么吗?

因为 , you need to test this outside the confines of Dragon Speech Recognition. I say this because, with a simple test, it's clear SendKeys 表现符合预期。

Dim shell: Set shell = WScript.CreateObject("WScript.Shell")
Call shell.Run("notepad")
Call WScript.Sleep(100)
Call shell.AppActivate("Notepad")
Call shell.SendKeys("{{}")
Call WScript.Sleep(100)
Call shell.SendKeys("{}}")

输出(在记事本中):

{}