Can we add Windows Scripting Host to FS
Posted: Tue Jan 08, 2013 6:53 am
Can we add WSH to FS3?
I have prepared a little script that shows its relatively simple to add scripting capabilities. It runs a script from inside a script, but it could just as easily be an executable or a VST dll its running from. I realize its a little more complex to do in C++, but not that much. Thousands of programs have this available with great success.
I figure that since you are already in the scripting area fixing the Ruby implimentation, (Re: this thread http://www.dsprobotics.com/support/viewtopic.php?f=2&t=941&start=40 I'd ask you to add this while you're at it.
This would almost completely open up windows to us, we'd have access to ALL the COM objects, and I believe .NET as well? Although I'm not 100% sure on that. So the idea is that anything that can't be done in Ruby, could be done with J-Script and we could create our own com objects and call them from our scripts.
SET ScriptHost = CreateObject("MSScriptControl.ScriptControl")
Just copy this whole script to a Text file and give it a .VBS extension. Then double click it.
I want to be clear though, I'm not asking for this instead of Ruby, its in addition. There is obviously some problems and challenges with fully implimenting Ruby that goes beyond just the static linking. Even if that gets to working (which I strongly believe it will) it still does not answer the question of OLE and other things. So, in that case, the WSH modual could step in and be used to handle all things Windows, even including DirectX...
Anyways, is there any reason we can't have this?
Thank you
I have prepared a little script that shows its relatively simple to add scripting capabilities. It runs a script from inside a script, but it could just as easily be an executable or a VST dll its running from. I realize its a little more complex to do in C++, but not that much. Thousands of programs have this available with great success.
I figure that since you are already in the scripting area fixing the Ruby implimentation, (Re: this thread http://www.dsprobotics.com/support/viewtopic.php?f=2&t=941&start=40 I'd ask you to add this while you're at it.
This would almost completely open up windows to us, we'd have access to ALL the COM objects, and I believe .NET as well? Although I'm not 100% sure on that. So the idea is that anything that can't be done in Ruby, could be done with J-Script and we could create our own com objects and call them from our scripts.
SET ScriptHost = CreateObject("MSScriptControl.ScriptControl")
Just copy this whole script to a Text file and give it a .VBS extension. Then double click it.
Code: Select all
Dim ScriptHost 'Just some variable declarations
Dim CodeLine
Dim Prmpt
SET ScriptHost = CreateObject("MSScriptControl.ScriptControl")
Prmpt = "I am running in the second instance of the Windows Scripting Host. The first instance "
Prmpt = Prmpt + "was used to run the script that would create the second instance! (Me) "
Prmpt = Prmpt + "FYI: The first instance would represent Flowstone, the second instance "
Prmpt = Prmpt + "would represent a user script"
CodeLine = "MSGBOX " & Chr(34) & Prmpt & Chr(34) & ",32," & chr(34) & "See how easy This is" & chr(34)
ScriptHost.Language = "VBSCRIPT"
ScriptHost.ExecuteStatement CodeLine
I want to be clear though, I'm not asking for this instead of Ruby, its in addition. There is obviously some problems and challenges with fully implimenting Ruby that goes beyond just the static linking. Even if that gets to working (which I strongly believe it will) it still does not answer the question of OLE and other things. So, in that case, the WSH modual could step in and be used to handle all things Windows, even including DirectX...
Anyways, is there any reason we can't have this?
Thank you