Posts: 2
Threads: 1
Joined: Dec 2005
I'm trying to use hot-keys to send VBS commands to another app... is something like this possible:
Quote:lpstr vbs=
Set SomeApp = WScript.CreateObject("Some.Application")
SomeApp.Function()
VbsExec vbs
Thanks!!
Posts: 12,140
Threads: 142
Joined: Dec 2002
Yes but without WScript.. WScript object can be used only when the script is executed by Windows Script Host, eg when you run a vbs file. Similarly, WScript.Echo mut be replaced to MsgBox, and so on.
Posts: 2
Threads: 1
Joined: Dec 2005
I'll try and track down an alternate way to speak to my app - thanks.
When using a hot-key to trigger just a line or so of VBS, as above, would I create a 'function' for each action or a 'macro' for each? Would both functions or macros need to be added to init2 to be availabe from launch?
Thanks again!
Posts: 12,140
Threads: 142
Joined: Dec 2002
Use init2 only to launch something when QM starts or file opened. Neither macros nor functions don't need to be declared.
In this case, you can create a macro or a function. In most cases, to automate something, use macros. But keep in mind that only single macro can run at a time, and therefore sometimes it is better to use function, because multiple functions can run simultaneously.