Utilizing VB Script execution?

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

TEDennis
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 41
Joined: Tue Apr 11, 2006 12:36 am

Utilizing VB Script execution?

Post by TEDennis » Wed Apr 26, 2006 11:00 pm

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 ?

kray
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 56
Joined: Sat Apr 08, 2006 5:28 pm
Location: Eau Claire, WI
Contact:

Re: Utilizing VB Script execution?

Post by kray » 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!
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com

TEDennis
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 41
Joined: Tue Apr 11, 2006 12:36 am

Re: Utilizing VB Script execution?

Post by TEDennis » Thu Apr 27, 2006 12:43 pm

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

kray
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 56
Joined: Sat Apr 08, 2006 5:28 pm
Location: Eau Claire, WI
Contact:

Re: Utilizing VB Script execution?

Post by kray » Thu Apr 27, 2006 9:56 pm

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...
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com

statikeffeck
Posts: 3
Joined: Thu Dec 21, 2006 3:52 pm
Location: New Jersey, USA
Contact:

Post by statikeffeck » Wed Jan 10, 2007 4:42 pm

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Post by mwieder » Fri Feb 09, 2007 6:24 pm

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.

McJazz
Posts: 111
Joined: Sun Apr 04, 2010 5:59 am

Re: Utilizing VB Script execution?

Post by McJazz » Wed Mar 16, 2011 4:16 am

Does anyone have examples of how to control MS Office Applications like Access using Live Code with VBScript or otherwise?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Utilizing VB Script execution?

Post by BvG » Wed Mar 16, 2011 12:22 pm

uhm.. you can "do as vbsvcript"?

check "the alternateLanguages" it'll contain the name to use for language in "do" on windows.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

McJazz
Posts: 111
Joined: Sun Apr 04, 2010 5:59 am

Re: Utilizing VB Script execution?

Post by McJazz » Sun May 15, 2011 7:08 am

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

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Utilizing VB Script execution?

Post by tetsuo29 » Fri Feb 26, 2021 10:38 pm

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.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Utilizing VB Script execution?

Post by bogs » 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
Image

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Utilizing VB Script execution?

Post by tetsuo29 » Mon Mar 01, 2021 7:13 pm

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. :)

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Utilizing VB Script execution?

Post by bogs » Mon Mar 01, 2021 7:28 pm

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.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Utilizing VB Script execution?

Post by FourthWorld » Mon Mar 01, 2021 7:40 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Utilizing VB Script execution?

Post by bogs » Mon Mar 01, 2021 8:02 pm

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.
Image

Post Reply

Return to “Windows”