Utilizing VB Script execution?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Utilizing VB Script execution?
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 ?
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 ?
-
- VIP Livecode Opensource Backer
- Posts: 56
- Joined: Sat Apr 08, 2006 5:28 pm
- Location: Eau Claire, WI
- Contact:
Re: Utilizing VB Script execution?
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):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 ?
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
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com
Re: Utilizing VB Script execution?
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
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
-
- VIP Livecode Opensource Backer
- Posts: 56
- Joined: Sat Apr 08, 2006 5:28 pm
- Location: Eau Claire, WI
- Contact:
Re: Utilizing VB Script execution?
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:Yeah, that's what I thought it meant.
Being able to "execute VB Script" is a very misleading claim, IMO.
No idea... I don't think so, though. I'm sure anyone who wanted to do that would write a DLL...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.
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com
-
- Posts: 3
- Joined: Thu Dec 21, 2006 3:52 pm
- Location: New Jersey, USA
- Contact:
Re: Utilizing VB Script execution?
Does anyone have examples of how to control MS Office Applications like Access using Live Code with VBScript or otherwise?
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
Re: Utilizing VB Script execution?
uhm.. you can "do as vbsvcript"?
check "the alternateLanguages" it'll contain the name to use for language in "do" on windows.
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
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Utilizing VB Script execution?
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
Thanks
Re: Utilizing VB Script execution?
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.kray wrote: ↑Thu Apr 27, 2006 5:40 amIt 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):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 ?
Have fun!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
Re: Utilizing VB Script execution?
You may want to look in the dictionary, a *lot* has changed since a decade and a half ago hee hee
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
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
Re: Utilizing VB Script execution?
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?
I'll use Jacque's excuse, in reverse, "...my morning coffee had worn off by this point..."
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.
-
- VIP Livecode Opensource Backer
- Posts: 9852
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Utilizing VB Script execution?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Utilizing VB Script execution?
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.FourthWorld wrote: ↑Mon Mar 01, 2021 7:40 pmThe 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.
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.