Anthony_Gischen Posted May 19, 2006 Share Posted May 19, 2006 (edited) Hi I have downloaded autoit and think it is great. I want to run a simple script that opens an external program. I have basically manipulated the vbs scripts that come standard with the app. However when I run it it does not do anything. I have added the script below. Hope someone can point me in the right direction Anthony Option Explicit '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Declare Variables & Objects '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim oShell Dim oAutoIt '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Initialise Variables & Objects '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set oShell = WScript.CreateObject("WScript.Shell") Set oAutoIt = WScript.CreateObject("AutoItX3.Control") '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Start of Script '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' oAutoIt.Run "AcroRd32.exe", "C:\Program Files\Adobe\Acrobat 7.0\Reader" WScript.Quit Edited May 19, 2006 by Anthony_Gischen Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 (edited) Might want to download the Beta (will be needed) and take a look at Objects in there on how to use / impliment them.Edit:Beta: http://www.autoitscript.com/forum/index.php?showtopic=19717 Edited May 19, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted May 19, 2006 Share Posted May 19, 2006 1 Welcome to the forums 2 your script, as written, will not work with autoit 3 i wrote this just a few minutes ago #include <GUIConstants.au3> $folder = FileSelectFolder("Choose a folder.", "") Run("explorer.exe " & $folder) WinWaitActive("") $window = WinGetTitle("") Sleep(5000) While 1 If WinActive($window) Then MsgBox(0,"Found", "The window is active" & @CRLF & $window, 2) Sleep(15000) WEnd it opens a folder in explorer 8) Link to comment Share on other sites More sharing options...
dabus Posted May 19, 2006 Share Posted May 19, 2006 Er, I think all he want's is Run("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe") Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 Er, I think all he want's is Run("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe")I don't think so, looks like he's trying to run it "from" his vb script via the AutoIt DLL, but you may be right that all he would need to do is execute that one line Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
dabus Posted May 19, 2006 Share Posted May 19, 2006 I'd would not know why he wants to run vba and within that autoit, if he just wants to start the reader. I'd stick with one lang so things don't get messed up. Link to comment Share on other sites More sharing options...
Confuzzled Posted May 19, 2006 Share Posted May 19, 2006 From the help file:A variable is just a place to store data in memory so that it can be accessed quickly. Think of it as a mailbox in memory that you can put information in or take information out of. For example you might create a variable to store the number a user's response to a question, or the result to a math equation.Each variable has a name (again, similar to a mailbox) and must start with the $ character and may only contain letters, numbers and the underscore _ character. Here are some example names: Yeah, I know - the almighty dollar, yet again!!! Link to comment Share on other sites More sharing options...
Anthony_Gischen Posted May 19, 2006 Author Share Posted May 19, 2006 Thanks dabus for pointing mein the right direction 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