Page 1 of 2

Utilizing VB Script execution?

Posted: Wed Apr 26, 2006 11:00 pm
by TEDennis
OK, I'll bite --

The above Subject line was taken from the Forum description.

On the runrev features page:
http://dreamcard.runrev.com/section/features.php

It says "Execute VB Script" -- "Automate programs that are VB-Scipt compatible".

That makes TWO references that make it appear that Revolution can "execute VB Script'.

But, I see no reference to anything like that in any of the 2.7 documentation, or anywhere else.

What does "Execute VB Script" REALLY mean ?

Re: Utilizing VB Script execution?

Posted: Thu Apr 27, 2006 5:40 am
by kray
TEDennis wrote:It says "Execute VB Script" -- "Automate programs that are VB-Scipt compatible".

That makes TWO references that make it appear that Revolution can "execute VB Script'.

But, I see no reference to anything like that in any of the 2.7 documentation, or anywhere else.

What does "Execute VB Script" REALLY mean ?
It means that you can create VBS files from inside Rev by writing VBScript code to a .vbs file, and then run it with shell(). Here's my compact handler to do all of that (simply pass it the VBScript code and it will do it all for you):

Code: Select all

function stsDoVBS pVBScript
  put "C:\VBS_temp.vbs" into tVBSPath
  put pVBScript into url ("file:" & tVBSPath)
  set the hideConsoleWindows to true
  get shell("cscript.exe //nologo" && tVBSPath)
  put it into tResult
  if there is a file tVBSPath then
    send "delete file" && quote & tVBSPath & quote to me in 1 second
  end if
  if tResult <> "" then return tResult
end stsDoVBS
Have fun!

Re: Utilizing VB Script execution?

Posted: Thu Apr 27, 2006 12:43 pm
by TEDennis
Yeah, that's what I thought it meant.

Being able to "execute VB Script" is a very misleading claim, IMO.

No other languages were mentioned there, so it sounded like there was special support for VB Script. Why did they specifically mention VB Script, when in reality all the "execute" does is fire off an external task. That could be done with ANY language -- or ANY app, for that matter.

I built a Rev app that invokes Word's SpellCheck over an entire library of several thousand members of HELP text by doing something similar to what you provided. It communicates back and forth through a couple of disk files. Apps like that are very touchy and time sensitive, so when I ran across that "execute VB Script" claim, I thought there might be a way to directly access VB Script.

Has anybody done any research into, or had any success invoking, Microsoft Office apps as a Process ? Any ideas on how to implement something like that? I know it can be done with a DLL, but I'm trying to remain "native" if possible so other environments can be "plugged in" without having to write another DLL.

Thanks for the help.

TED

Re: Utilizing VB Script execution?

Posted: Thu Apr 27, 2006 9:56 pm
by kray
TEDennis wrote:Yeah, that's what I thought it meant.

Being able to "execute VB Script" is a very misleading claim, IMO.
Agreed... it would be better if "do script" were extended to say "as VBScript" in addition to "as AppleScript" so that the claim would be more genuine.
TEDennis wrote:Has anybody done any research into, or had any success invoking, Microsoft Office apps as a Process ? Any ideas on how to implement something like that? I know it can be done with a DLL, but I'm trying to remain "native" if possible so other environments can be "plugged in" without having to write another DLL.
No idea... I don't think so, though. I'm sure anyone who wanted to do that would write a DLL...

Posted: Wed Jan 10, 2007 4:42 pm
by statikeffeck
I think you can use use

"call start C:/pathToOffice/office.exe" as a shell command and it will launch in a separate process. not sure if that is what you are talking about though.

Posted: Fri Feb 09, 2007 6:24 pm
by mwieder
I control Office apps from rev through the use of a spawned vbscript task that interacts with Office COM objects, if that's what you mean.

Re: Utilizing VB Script execution?

Posted: Wed Mar 16, 2011 4:16 am
by McJazz
Does anyone have examples of how to control MS Office Applications like Access using Live Code with VBScript or otherwise?

Re: Utilizing VB Script execution?

Posted: Wed Mar 16, 2011 12:22 pm
by BvG
uhm.. you can "do as vbsvcript"?

check "the alternateLanguages" it'll contain the name to use for language in "do" on windows.

Re: Utilizing VB Script execution?

Posted: Sun May 15, 2011 7:08 am
by McJazz
I have Lua installed, but it does not show up as an alternate language on a Windows 7 machine. Any ideas on how to install so that is seen as active?

Thanks

Re: Utilizing VB Script execution?

Posted: Fri Feb 26, 2021 10:38 pm
by tetsuo29
kray wrote:
Thu Apr 27, 2006 5:40 am
TEDennis wrote:It says "Execute VB Script" -- "Automate programs that are VB-Scipt compatible".

That makes TWO references that make it appear that Revolution can "execute VB Script'.

But, I see no reference to anything like that in any of the 2.7 documentation, or anywhere else.

What does "Execute VB Script" REALLY mean ?
It means that you can create VBS files from inside Rev by writing VBScript code to a .vbs file, and then run it with shell(). Here's my compact handler to do all of that (simply pass it the VBScript code and it will do it all for you):

Code: Select all

function stsDoVBS pVBScript
  put "C:\VBS_temp.vbs" into tVBSPath
  put pVBScript into url ("file:" & tVBSPath)
  set the hideConsoleWindows to true
  get shell("cscript.exe //nologo" && tVBSPath)
  put it into tResult
  if there is a file tVBSPath then
    send "delete file" && quote & tVBSPath & quote to me in 1 second
  end if
  if tResult <> "" then return tResult
end stsDoVBS
Have fun!
Thank you so much for posting this 15 years ago! It helped me so much on a current project. I'm generating some VBScript and when I run it using "do as vbscript" it executes so slowly but, when I save it to a temp file and execute in the manner you've demonstrated it runs at optimal speed.

Re: Utilizing VB Script execution?

Posted: Fri Feb 26, 2021 10:51 pm
by bogs
You may want to look in the dictionary, a *lot* has changed since a decade and a half ago hee hee :twisted:

In particular, do as alternateLanguage may have some appeal for you these days...unless, of course, you use 'nix, which means you can't use this :P

Re: Utilizing VB Script execution?

Posted: Mon Mar 01, 2021 7:13 pm
by tetsuo29
bogs wrote:
Fri Feb 26, 2021 10:51 pm
You may want to look in the dictionary, a *lot* has changed since a decade and a half ago hee hee :twisted:

In particular, do as alternateLanguage may have some appeal for you these days...unless, of course, you use 'nix, which means you can't use this :P
So.. I'm guessing you missed the part of my post where I mention that the code I'm generating was running way too slowing using "do as vbscript"? LOL. Don't worry, I've done it too. :)

Re: Utilizing VB Script execution?

Posted: Mon Mar 01, 2021 7:28 pm
by bogs
tetsuo29 wrote:
Mon Mar 01, 2021 7:13 pm
So.. I'm guessing you missed the part of my post where I mention that the code I'm generating was running way too slowing using "do as vbscript"?
I'll use Jacque's excuse, in reverse, "...my morning coffee had worn off by this point..." :P

Although I am curious why do as alternate language would perform that much slower. Not curious enough to actually start using one of the newer IDEs, though.

Re: Utilizing VB Script execution?

Posted: Mon Mar 01, 2021 7:40 pm
by FourthWorld
bogs wrote:
Fri Feb 26, 2021 10:51 pm
You may want to look in the dictionary, a *lot* has changed since a decade and a half ago hee hee :twisted:

In particular, do as alternateLanguage may have some appeal for you these days...unless, of course, you use 'nix, which means you can't use this :P
The shell function was and remains the solution on platforms that support stdIn/stdOut, such as Unix on which this engine was born.

The alternateLanguage option was added much later, originally to accommodate Apple's AppleScript, which (like so much from Apple in those days) didn't use common conventions like stdIn/stdOut.

Re: Utilizing VB Script execution?

Posted: Mon Mar 01, 2021 8:02 pm
by bogs
FourthWorld wrote:
Mon Mar 01, 2021 7:40 pm
The alternateLanguage option was added much later, originally to accommodate Apple's AppleScript, which (like so much from Apple in those days) didn't use common conventions like stdIn/stdOut.
I have no idea what you are talking about. "do as language" along with "alternateLanguage" has been around since Mc 2.5 at least for Mac's appleScript. I assumed it was there since the beginning, although of course I have no way to find that out haha, I know appleScript was available since Hc of course.

Image

Of course, adding vbScript to the alternate languages means that Windows can now use it as well, but what is it your trying to say about stdIn/stdOut ? OSX certainly has that and last I heard, so does Windows.

Are you saying that because 'nix has it as well, that 'nix users should not be included? Or are you saying we should all drop that hokey stuff and not use it anywhere?

Frankly, I'm fine with shell myself, since I'm almost never out of Mc, and certainly not past 6.x by choice, so if you feel like clarifying a bit I'd sure appreciate it.