Guest Jonte Posted October 4, 2005 Posted October 4, 2005 How can I pass some parameters to a AutoIt Script? Like this: PYTHON os.system( "test.au3 A54323323 Login" ) AutoIT for arg in argv print arg All help is needed
DaveF Posted October 4, 2005 Posted October 4, 2005 AutoIt has an array variable named $CMDLINE that holds command-line arguments, and the number of command-line arguments in $CMDLINE[0] Dim $ourMessage If $CMDLINE[0] Then For $step = 1 To $CMDLINE[0] $ourMessage = $ourMessage & "Command-line arg #" & $step & " = " & $CMDLINE[$step] & @CRLF Next MsgBox(0, "Debug", $ourMessage) Else MsgBox(0, "Error", "No command-line arguments provided.") EndIf Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.
Guest Jonte Posted October 4, 2005 Posted October 4, 2005 THANKS NOW IT WORKS AS IT SHOULD.... //KANON BRA, VERY GOOD...
Michel Claveau Posted October 6, 2005 Posted October 6, 2005 (edited) Hi ! With Python, you can, also, control AutoIt-X, via PyWin32. Exemple : import time from win32com.client import Dispatch Auto = Dispatch("AutoItX3.Control") Auto.Run("calc.exe") Auto.Run("notepad.exe") time.sleep(1) Auto.Send("AZERTYUIOP = ") time.sleep(1) titreFenetre = 'Calculatrice' Auto.WinActivate(titreFenetre , '') time.sleep(1) Auto.Send("12345") time.sleep(0.4) Auto.Send("{+}") time.sleep(0.4) Auto.Send("54321") time.sleep(0.4) Auto.Send("{=}") time.sleep(0.4) Auto.Send("^c") time.sleep(1) Auto.WinClose(titreFenetre , '') Auto.Send("^v") Auto.Send("{ENTER}") This run OK on a French's Windows XP The title of the windows ("Calculatrice") can change, in english. Few "time.sleep(" are here, for give time for to view. Edited October 6, 2005 by Michel Claveau
JoeyJoeJOe Posted October 7, 2005 Posted October 7, 2005 This is a stupid question I'm sure but where do I put AutoItX3.dll in order for this to work. I keep getting a error on Auto = Dispatch("AutoItX3.Control")Hi ! With Python, you can, also, control AutoIt-X, via PyWin32.Exemple : import time from win32com.client import Dispatch Auto = Dispatch("AutoItX3.Control") Auto.Run("calc.exe") Auto.Run("notepad.exe") time.sleep(1) Auto.Send("AZERTYUIOP = ") time.sleep(1) titreFenetre = 'Calculatrice' Auto.WinActivate(titreFenetre , '') time.sleep(1) Auto.Send("12345") time.sleep(0.4) Auto.Send("{+}") time.sleep(0.4) Auto.Send("54321") time.sleep(0.4) Auto.Send("{=}") time.sleep(0.4) Auto.Send("^c") time.sleep(1) Auto.WinClose(titreFenetre , '') Auto.Send("^v") Auto.Send("{ENTER}")This run OK on a French's Windows XPThe title of the windows ("Calculatrice") can change, in english.Few "time.sleep(" are here, for give time for to view.
Rraney Posted October 13, 2005 Posted October 13, 2005 I have been using whats suggested under the AutoItX Helpfile. Before you can use it you need to register it with the Windows OS. To register the COM interface:1....Open a command prompt2....Change directory (using CD) to the directory that contains AutoItX3.dll3....Type regsvr32.exe AutoItX3.dll and press enterThe name you use after registering AutoItX control is 'AutoItX3.Control'example in Python would be: import win32com.cliento = win32com.client.Dispatch( "AutoItX3.Control" )This is a stupid question I'm sure but where do I put AutoItX3.dll in order for this to work. I keep getting a error on Auto = Dispatch("AutoItX3.Control")
Ryan Lowe Posted November 22, 2005 Posted November 22, 2005 Im having problems with the AutoItX3.Control in Python. Some of the functions are not being found, like WinGetActiveTitle or WinMinimize, while others like the ones in your example do work. The tooltip shows (strRun=<PyOleEmpty object at 0x0042E506>, ... This is what the win32 object says after AutoIt is Dispatched <win32com.gen_py.AutoItX3 1.0 Type Library.IAutoItX3 instance at 0x15441312> Something is clearly not linked or registered correctly, but I cant figure out what I can do about it. Anyone have a suggestion? Thanks Hi ! With Python, you can, also, control AutoIt-X, via PyWin32. Exemple : import time from win32com.client import Dispatch Auto = Dispatch("AutoItX3.Control") Auto.Run("calc.exe") Auto.Run("notepad.exe") time.sleep(1) Auto.Send("AZERTYUIOP = ") time.sleep(1) titreFenetre = 'Calculatrice' Auto.WinActivate(titreFenetre , '') time.sleep(1) Auto.Send("12345") time.sleep(0.4) Auto.Send("{+}") time.sleep(0.4) Auto.Send("54321") time.sleep(0.4) Auto.Send("{=}") time.sleep(0.4) Auto.Send("^c") time.sleep(1) Auto.WinClose(titreFenetre , '') Auto.Send("^v") Auto.Send("{ENTER}") This run OK on a French's Windows XP The title of the windows ("Calculatrice") can change, in english. Few "time.sleep(" are here, for give time for to view.
Ryan Lowe Posted November 23, 2005 Posted November 23, 2005 Nevermind, I guess the methods changed for version 3 (eg WinGetTitle instead of WinGetActiveTitle). The AutoItX helpfile gives the right list. The online reference and all the examples I could find seem not to be correct. Oh well, now Im happy. Im having problems with the AutoItX3.Control in Python. Some of the functions are not being found, like WinGetActiveTitle or WinMinimize, while others like the ones in your example do work. The tooltip shows (strRun=<PyOleEmpty object at 0x0042E506>, ...This is what the win32 object says after AutoIt is Dispatched<win32com.gen_py.AutoItX3 1.0 Type Library.IAutoItX3 instance at 0x15441312>Something is clearly not linked or registered correctly, but I cant figure out what I can do about it. Anyone have a suggestion?Thanks
Michel Claveau Posted November 24, 2005 Posted November 24, 2005 Hi! Very fun. Other thing : you can, also, call Python from AutoIt! It's necessary to use AutoIt beta, and PyWin (from Martk Hammond), like COM-server. With that, it's possible to use AutoIt like GUI for Python. And, it is possible to script in Python inside AutoIt (with limitations, but it's possible). Have a good day, and sorry for my *bad* english.
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