Editing a VB script from within Revolution

Thomas McGrath III 3mcgrath at adelphia.net
Wed Mar 22 13:57:28 EST 2006


Ken,

Thanks for the quick response. Is cscript.exe available on All  
windows computers OR does it need to be installed with some certain  
software?

I have installed so many things now on the PC that I don't know what  
will work without relying on these other installs.

I am off to test your script and see what i can do.

Thanks again,

Tom

On Mar 22, 2006, at 1:32 PM, Ken Ray wrote:

> On 3/22/06 12:26 PM, "Thomas McGrath III" <3mcgrath at adelphia.net>  
> wrote:
>
>> Hello,
>>
>> Does anyone know or can show me how to edit and run a VB script from
>> with a Rev stack?
>>
>> I want to change item's in the VB script and then run it like I am
>> doing with Applescript on the Mac side.
>>
>> I know how to launch an external script from within REV but I want to
>> run a script stored in a field or custom property within REV.
>>
>> answer file "Run VB script" with "OK" and "Cancel"
>> if it is not " then launch it with "WScript.exe"
>>
>> Also, Does anyone know how to get VB scripts to execute with out
>> having the user to instal WSH WScript.exe ?
>
> Yes, you can use 'cscript.exe' and run it from the command-line.  
> Here's my
> all-purpose handler for running scripts from Rev:
>
> function stsDoScript pScript,pScriptType,pDirectToConsole
>   if pScriptType ="" then put "AppleScript" into pScriptType
>
>   replace "`" with quote in pScript
>   switch pScriptType
>   case "AppleScript"
>   case "AS"
>     do pScript as "AppleScript"
>     put the result into tResult
>     break
>   case "VB Script"
>   case "VBS"
>     set the hideConsoleWindows to true
>     if pDirectToConsole = "" then
>       put "C:\libVBS_temp.vbs" into tVBSPath
>       put pScript into url ("file:" & tVBSPath)
>       get shell("cscript.exe //nologo" && tVBSPath)
>     else
>       get shell("cscript.exe" && pScript)
>     end if
>     put it into tResult
>     if there is a file tVBSPath then
>       send "delete file" && quote & tVBSPath & quote to me in 1 second
>     end if
>     break
>   case "JS"
>   case "JavaScript"
>     if "javascript" is among the lines of the alternateLanguages then
>       do pScript as "JavaScript"
>       put the result into tResult
>     else
>       put "Error: JavaScript OSA component not installed." into  
> tResult
>     end if
>     break
>   end switch
>   return tResult
> end stsDoScript
>
> To call it, do something like:
>
> put the uVBScript of this stack into tScript
> -- or wherever you have your VBS code
> get stsDoScript(tScript,"VBS")
> if it <> "" then
>   answer it
> end if
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Thomas J McGrath III
3mcgrath at adelphia.net

Lazy River Software™ - http://www.lazyriversoftware.com

Lazy River Metal Art™ - http://www.lazyriversoftware.com/metal.html

Meeting Wear™ - http://www.cafepress.com/meetingwear

Semantic Compaction Systems - http://www.minspeak.com

SCIconics, LLC - http://www.sciconics.com/sciindex.html










More information about the use-livecode mailing list