robert-hk Posted September 14, 2005 Report Share Posted September 14, 2005 Are there any recommendations for using ME to control several VBscript files? Specifically, with Windows Script Host and ME integration, are there good reasons for choosing cscript or wscript? All ideas very welcome. Bob Quote Link to comment Share on other sites More sharing options...
joe Posted September 14, 2005 Report Share Posted September 14, 2005 Hello Robert-HK! There are examples of controlling VBScript using Macro Express in the Third-Party forum. Here is a link to one that sorts strings. There are also examples of running HTAs from Macro Express. Many VBScript files can be run at the same time, and all can be launched from within Macro Express. The trick is to get Macro Express to pause until the script finishes. One way is to have your VBScript file write a dummy file when it ends, and have Macro Express wait until it sees the file before continuing. Cscript is generally used for debugging and wscript is run by default when clicking on a .vbs or .wsh file. Quote Link to comment Share on other sites More sharing options...
robert-hk Posted September 15, 2005 Author Report Share Posted September 15, 2005 Joe Thanks for that example. I noticed when running it that I got a warning from Norton as shown in the attached image. With ME I can check for this and allow processing to proceed but is there a simpler way, apart from turning off Norton? To handle exceptions and observe progress of the script, it seems that wscript.echo would provide a series of windows which could be checked for by ME. Do you see any problems with this approach? Thanks Quote Link to comment Share on other sites More sharing options...
joe Posted September 15, 2005 Report Share Posted September 15, 2005 We do not use Norton so I cannot give any advice on it. Maybe there is a way to set Norton so that files within a particular folder can be run without exception. If so, then you need only change the output folder within the macro. Others in this forum that use Norton, or maybe even the Norton forum itself, might have solutions. I'm not sure how well the wscript.echo command would work in this situation because it requires you to click the "OK" button when it, er, echoes something. Most of the scripts we create for clients do not require user interaction. They are just fired up to do a task and then stop. Returning results to Macro Express is done through files, the Registry, or having the script generate a "runnable" macro command. When interaction is required, we generally use an HTA, which I am sure is something else that your Norton will feel itchy about. There are some examples of this in the Third Party Tools forum. All that being said, I am willing to bet there are more "elegant" ways to handle interaction between Macro Express and the Windows Script Host, but we have not yet investigated them. Quote Link to comment Share on other sites More sharing options...
robert-hk Posted September 16, 2005 Author Report Share Posted September 16, 2005 Joe, Thanks for the advice. I'm still finding my way in the world of scripting and intending to use ME as a kind of "wrapper" for the various useful scripts and utilities I find. For example, I sometimes need to convert some JPEGs into PDFs, add a document control sheet and have a single PDF as output with the control sheet (originally Excel) as the first sheet. To do this, I print the Excel to a pdf using a pdf printer. I use ImageMagick via the command prompt to convert and combine the JPEGs with tight control over compression, resolution and so on. I then use the pdftk toolkit via the command line to combine the various pdfs as I want them. (see http://www.imagemagick.org/script/index.php and http://www.accesspdf.com/pdftk/ ) ME seems the best way to tie all this together with consistent naming conventions and directory structures. The HTA approach you cited looks like a good candidate for "wrapping" imagemagick since I never use any of these command line tools often enough to remember usage parameters. Time for me to study your examples further. Robert Quote Link to comment Share on other sites More sharing options...
robert-hk Posted September 22, 2005 Author Report Share Posted September 22, 2005 While learning about this area I came upon this link: http://www.qa.com/training/portfolio/micro...px?id=Monad-MSH It has various observations about styles of scripting and Microsoft's plan for Monad. Might be of interest to some. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.