如何制作一个可以按方向键的vbs文件?

问题描述 投票:0回答:1

我正在使用语音命令软件,它仍处于测试阶段,但非常好 我发现唯一的大问题是文件夹和文件中的导航

所以我想我会制作一个 vbs 脚本,用我的声音触发。 例如:我说离开了按下左箭头的vbs文件被按下

我只需要击键代码

再次按箭头键移动突出显示的文件夹,这就是我想要做的

请有人帮我为此编写一个代码

谢谢你

vbscript
1个回答
0
投票

这可能会帮助您创建脚本

    'create shell script object which key stork and move arround the screen
    set WshShell = WScript.CreateObject("WScript.Shell")

    Set shell = wscript.CreateObject("Shell.Application")
    shell.Open "C:\export\script"

    WshShell.SpecialFolders("C:\export\script")
    WshShell.specialFolders.item(0)
    WshShell.SendKeys "{LEFT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{LEFT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{DOWN}"
    WScript.Sleep 1000
    WshShell.SendKeys "{DOWN}"
    WScript.Sleep 1000
    WshShell.SendKeys "{DOWN}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{RIGHT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{LEFT}"
    WScript.Sleep 1000
    WshShell.SendKeys "{UP}"
    WScript.Sleep 1000 
© www.soinside.com 2019 - 2024. All rights reserved.