Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Using VBS
#1
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!!
#2
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.
#3
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!
#4
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)