PeterSwiss Posted January 3, 2006 Share Posted January 3, 2006 In vb script: function GetOpenWindows (vTitles as variant) where function result: is the number of titles, vTitles: is an array that contains the titles. How to use this function from Javascript? (Actually the result is even a 2-dimensional array [n][2] of title,WHND pairs, but this does not complicate the issue.) Link to comment Share on other sites More sharing options...
Zach Posted January 5, 2006 Share Posted January 5, 2006 <script type=text/Jscript> ai = new ActiveXObject( "AutoItX3.Control.1" ); </script> If you have Frontpage 2003, if you where to type "ai." in the blank line above - it will show you all thats available. Obviously - that works for any com component <script type=text/Jscript> ai = new ActiveXObject( "AutoItX3.Control.1" ) ai.Send ("#r") ai.WinWaitActive ("Run") ai.Send ("notepad.exe{Enter}") ai.WinWaitActive ("Untitled -") ai.Send ("!FO") ai.WinWaitActive ("Open") ai.Send ("http://FantasySportsWire.com") ai.Send ("{Enter}") ai.WinWaitActive ("FantasySportsWire") text = ai.WinGetText ("FantasySportsWire", "") ai.WinKill ("FantasySportsWire") document.write("<base href=http://fsw2.com>" + text) </script> Link to comment Share on other sites More sharing options...
Zach Posted January 5, 2006 Share Posted January 5, 2006 (oh - and that is officially the oddest way I have ever tried to get someone to go to my forums ) Link to comment Share on other sites More sharing options...
PeterSwiss Posted February 1, 2006 Author Share Posted February 1, 2006 In vb script: function GetOpenWindows (vTitles as variant) where function result: is the number of titles, vTitles: is an array that contains the titles. How to use this function from Javascript? (Actually the result is even a 2-dimensional array [n][2] of title,WHND pairs, but this does not complicate the issue.) That's an autoreply, from me to me: learn vbscript, it is not difficult and helpful anyway. Then mix the script languages. Link to comment Share on other sites More sharing options...
PeterSwiss Posted February 3, 2006 Author Share Posted February 3, 2006 That's an autoreply, from me to me: learn vbscript, it is not difficult and helpful anyway. Then mix the script languages.Does someone know how to mix script languages, in the Windows Scripting Host environment? Link to comment Share on other sites More sharing options...
Zach Posted February 4, 2006 Share Posted February 4, 2006 (edited) Ya know - I misread your original question - oops Is this what you are looking for? (this is if done through HTML - I would have to look it up for straight script - been awhile since I messed with js that way) <script LANGUAGE="Javascript" FOR="ObjectName" EVENT="GetOpenWindows(vTitles, nextvar, anothervar, blahvar, mommyvar)"> for (i=0;i<39483984934893943939034993403493;i++) //do nothing a couple of times - obviously you can use the vars just as named, obviously also - no types </SCRIPT> Just to make sure that is what you are looking for - if it is - I can look it up and give you the straight script version with little difficulty (just got to find some of my old scripts on this blackhole of a computer of mine) Edited February 4, 2006 by Zach Link to comment Share on other sites More sharing options...
Zach Posted February 4, 2006 Share Posted February 4, 2006 (edited) or are you asking b=new Array() var a = new ActiveXObject( "Com.Name" ) var b=a.GetOpenWindows("I enter window title here") Then of course - b is the array that would be returned - ? Edited February 4, 2006 by Zach Link to comment Share on other sites More sharing options...
Zach Posted February 4, 2006 Share Posted February 4, 2006 Does someone know how to mix script languages, in the Windows Scripting Host environment?In the same script - nope , dont even know if its possible - in the same exact script (though thats a I dont know - so it could be)Would be kind of weird for it though - somehow it would have to know that you are switching - and then change scripting engines on the fly - Though you could set up one script as like the main base - and then have it run different scripts of different languages - even if all you need is a simple result from one - just pass it what it needs, get its output - pass that output over to another script.I do something similiar to that with PHP - I write most of my stuff in PHP - but use vb6 as the base (obviously an application as opposed to just being a script) - But I also use a bit of AutoIt - through the Com, and through normal, vbscript, jscript, and in some places - (like the entire gui - including titlebar, max/min buttons, main menu - etc) - use HTML - and awhole lot of com Link to comment Share on other sites More sharing options...
PeterSwiss Posted February 4, 2006 Author Share Posted February 4, 2006 <script language=hellscript> hell.kill.thread </script> Link to comment Share on other sites More sharing options...
FabrizioMarana Posted August 7, 2007 Share Posted August 7, 2007 Does someone know how to mix script languages, in the Windows Scripting Host environment?Yep<package><job> <runtime> <description>Here goes description </description> <example>Here goes example </example> </runtime> <script language="JScript">Here goes jscript </script> <script language="VBScript">Here goes VBScript </script></runtime></job></package>HTH,Fabrizio Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now