Editing a VB script from within Revolution
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 ? Thanks for any help in advance. Tom Thomas J McGrath III [EMAIL PROTECTED] 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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
On 3/22/06 12:26 PM, Thomas McGrath III [EMAIL PROTECTED] 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: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@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 [EMAIL PROTECTED] 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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
On 3/22/06 12:57 PM, Thomas McGrath III [EMAIL PROTECTED] wrote: 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? All computers going back to Win98. Win95 (prior to Internet Explorer 4.0) didn't have it yet, but Exporer 4.0 installed it. Which basically means everyone has it. :-) Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
Ken, If I understand this the VBS will run if VB Script is in pSriptType because there is no break after the case VB Script? I just never wrote a switch that way and well, this is the first time I've seen that. What is the difference between straight to console and not? Why is that important? Lastly, I notice that Python is not among the parameters. Is it not a choice or is it so different as to not work in this case? P.S. I just tried a vb script stored in a field and it worked and is awesome. Thank you so much for this. Tom On Mar 22, 2006, at 1:32 PM, Ken Ray wrote: case VB Script case VBS set the hideConsoleWindows to true if pDirectToConsole = then Thomas J McGrath III [EMAIL PROTECTED] 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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
On 3/22/06 1:10 PM, Thomas McGrath III [EMAIL PROTECTED] wrote: Ken, If I understand this the VBS will run if VB Script is in pSriptType because there is no break after the case VB Script? I just never wrote a switch that way and well, this is the first time I've seen that. Yes you're right. If there's no break, the case will fall through to the next case. I use this to provide different options to the end user. What is the difference between straight to console and not? Why is that important? Excellent question, and unfortunately one I can't remember! :-) I remember putting it into the code for others that may want to use the option, but I never have. And after looking on Microsoft's site, it looks like it may be no longer an option. So just ignore it for now. Lastly, I notice that Python is not among the parameters. Is it not a choice or is it so different as to not work in this case? To be honest, I know so little about Python that I didn't know if you can execute Python code in a similar way as VB Script. Do you know if it can? I'd love to extend stsDoScript, but don't know what needs to be done. P.S. I just tried a vb script stored in a field and it worked and is awesome. Thank you so much for this. My pleasure! Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Editing a VB script from within Revolution
Ken, Thanks, So which would the default be? straight to console = or not? I will look into Python. Not sure myself since python scripts use Python or PythonWin to execute. Thanks again, Tom On Mar 22, 2006, at 2:27 PM, Ken Ray wrote: What is the difference between straight to console and not? Why is that important? Excellent question, and unfortunately one I can't remember! :-) I remember putting it into the code for others that may want to use the option, but I never have. And after looking on Microsoft's site, it looks like it may be no longer an option. So just ignore it for now. Lastly, I notice that Python is not among the parameters. Is it not a choice or is it so different as to not work in this case? To be honest, I know so little about Python that I didn't know if you can execute Python code in a similar way as VB Script. Do you know if it can? I'd love to extend stsDoScript, but don't know what needs to be done. Thomas J McGrath III [EMAIL PROTECTED] 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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution