Scripting Aspect for HotKey
I use a VB Script to set a HotKey. Now I would like to enter this script in the scripting aspect , so I would have this action as a verb.
Someone can help?
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{F9}"
Answers
Use Simple Scripting Aspect. Enter the code enclosed in Sub - End Sub into the first Tab of aspect and apply. Enable verb over that Sub at the second tab.
I am curious if WshShell.SendKeys is able to send a keystroke to 800xA HotKey? Please update me if it works.
Please also add set WshShell = nothing to your code you don't want to create memory leaks.
This is now my code. I try to open the help by a "verb Button" by sending F1. But it's not working. Some idea?
sub OpenHelp()
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys"{F1}"
WshShell = nothing
end sub
Add new comment