VBScript... how much can we use it ?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Guillaume777
Newbie
Posts: 18
Joined: Sun Dec 22, 2002 2:41 am

VBScript... how much can we use it ?

Post by Guillaume777 » Sun Dec 22, 2002 7:58 am

I know VBscript can be used in a macro... however my question if how much ? I mean, can I do all the VBscript I want in macro scheduler or is there some limitation ?

Guillaume777
Newbie
Posts: 18
Joined: Sun Dec 22, 2002 2:41 am

Post by Guillaume777 » Sun Dec 22, 2002 8:12 am

ok I tried many thing with VBscript, and so far its working great. However it seems like many feature and event require some (html ?) objects (like "Document" ). Since there no such object in Macro Scheduler, does that mean that those options are not there ? Or can I simply use, say, a program as an object ?

Guillaume777
Newbie
Posts: 18
Joined: Sun Dec 22, 2002 2:41 am

Post by Guillaume777 » Sun Dec 22, 2002 8:17 am

for example if I want to do an "Sub xxx_Click" event in Macro Scheduler, can I do it ?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Dec 22, 2002 9:10 am

Guillaume777,

Once the control is transferred to WSH, Macro Scheduler has nothing to do with your .vbs until the control is returned back to your Macro Scheduler script.

The power of the VBscript extension depends upon the scope of objects you have. Even without creating instances of objects, VBscript language construct alone is more sophisticated. Once the control is transferred to a .vbs, you may lose the fine control of inserting keystrokes being pushed into the keyboard buffer.

On the other hand, Macro Scheduler's basic commands are a big time saver. It cuts tens of thousands of keystrokes in my daily computer usage flawlessly.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Dec 22, 2002 5:16 pm

Guillaume777,

Please look at the VBScript example that comes with the product and also the examples at http://www.mjtnet.com/scripts.hts

Armstrong seems to be referring to WSH and .vbs files which has nothing to do with using VBScript within Macro Scheduler scripts. WSH and .vbs files are external. You can of course run them with Run Program, but I think you are asking about the capabilities of VBScript *within* Macro Scheduler code.

Using the VBSTART and VBEND blocks you can embed as much VBScript as you like in your macros. The full capabilities of VBScript are available. As for the objects you wish to control, that depends on the ActiveX objects available to your system. You can create VBScript functions and subroutines and then run them from within the MacroScript code and have the VBScript functions set MacroScript variables. Therefore you have complete integration and can achieve 100% VBScript and 100% MacroScript.

The Document object you are reffering to is a web browser object and would be out of context inside a Macro Scheduler script. That is an object available to VBScript when run from within a web browser.

If you want to execute a web browser object use InternetExplorer.Application object. See:

https://www.mjtnet.com/scripts.hts?display+77

Also check out our VBScript resources page:

http://www.mjtnet.com/resources.htm
MJT Net Support
[email protected]

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Dec 22, 2002 10:14 pm

Hi Support,

Thanks for your clarification.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts