Michel Claveau Posted April 15, 2005 Share Posted April 15, 2005 (edited) Use VBS with AutoIt ? It's possible. It's easy.Follow this example : ;;; Michel Claveau Informatique;;; http://mclaveau.com$code= "Function mul2(x)"$code=$code & @CRLF & "mul2=x*2"$code=$code & @CRLF & "end Function"$code=$code & @CRLF$code=$code & @CRLF & "Function mul3(x)"$code=$code & @CRLF & "mul3=x*3"$code=$code & @CRLF & "end Function"$code=$code & @CRLF$code=$code & @CRLF & "Function mul4(x)"$code=$code & @CRLF & "mul4=x*4"$code=$code & @CRLF & "end Function"MsgBox(0,"Code VBS définit :",$code)$vbs = ObjCreate("ScriptControl")$vbs.language="vbscript"$vbs.addcode($code)$vbs.eval("MsgBox(""VBscript commence"",vbinformation,""Salut"")")$retour = $vbs.eval("mul2(123)")MsgBox(0,"Valeur retournée par VBS",$retour)$v=222$retour = $vbs.run("mul3",$v)MsgBox(0,"Avec passage de paramètre",$retour)$retour = $vbs.run("mul4",$v)MsgBox(0,"Test de vérification",$retour)(And, like said : MHz : Latest Autoit Beta Version is required)ça s'arrose, non ? Tchin-tchin à tous ! Edited April 25, 2005 by Michel Claveau Link to comment Share on other sites More sharing options...
Michel Claveau Posted April 15, 2005 Author Share Posted April 15, 2005 Use VBS with AutoIt ? It's possible. It's easy.ça s'arrose, non ? Tchin-tchin à tous ! <{POST_SNAPBACK}>And, the same way open the scripting with JScript (inside AutoIt)Have you s ? Link to comment Share on other sites More sharing options...
busysignal Posted April 16, 2005 Share Posted April 16, 2005 Use VBS with AutoIt ? It's possible. It's easy.Follow this example : ça s'arrose, non ? Tchin-tchin à tous ! <{POST_SNAPBACK}>ERROR: ObjCreate(): undefined function. $vbs = ObjCreate("ScriptControl)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^Michel,I received this message when running your script. What up??? Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2005 Share Posted April 16, 2005 The 1st post should have mentioned that the Latest Autoit Beta Version is required!!! Link to comment Share on other sites More sharing options...
Michel Claveau Posted April 19, 2005 Author Share Posted April 19, 2005 Michel,I received this message when running your script. What up??? <{POST_SNAPBACK}>Hi ! You must use AutoIt!version with COM's support (3.1.1+) Link to comment Share on other sites More sharing options...
randallc Posted April 20, 2005 Share Posted April 20, 2005 Hi, Michael, I am asking in ignorance; would you prefer to do this than just run a vbs script from Autoit? Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Michel Claveau Posted April 21, 2005 Author Share Posted April 21, 2005 Hi, Michael,I am asking in ignorance; would you prefer to do this than just run a vbs script from Autoit?Randall<{POST_SNAPBACK}>Hi !With COM's calls, for play VBS, it's possible to share variables with AutoIt.But, for me, it was only un fun test... Link to comment Share on other sites More sharing options...
atwolf359 Posted April 25, 2005 Share Posted April 25, 2005 Hi !With COM's calls, for play VBS, it's possible to share variables with AutoIt.But, for me, it was only un fun test... <{POST_SNAPBACK}>looks like this method would make a good .vbs to exe wrapper,if you complied the .au3 I've been on the net so long, I remember when I could only e-mail myself! Link to comment Share on other sites More sharing options...
bshoenhair Posted April 25, 2005 Share Posted April 25, 2005 Michel,I received this message when running your script. What up??? <{POST_SNAPBACK}>@busysignalYou are missing the closing quote after ScriptControl, should be: $vbs = ObjCreate("ScriptControl") 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