Kikileu Posted March 1, 2019 Posted March 1, 2019 hello, I'm new to autoit and I need help to automate a login to a page of my work, the problem is that it is for many people and I dont know how to do it so that the text box can be edited, and then with a button it is sent to the user/password box. Thanks expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\Santiago\Desktop\Form1.kxf Global $Form1 = GUICreate("Login user", 306, 233, -1, -1) Global $Input1 = GUICtrlCreateInput("Input1", 119, 43, 138, 21) Global $Input2 = GUICtrlCreateInput("Input2", 119, 90, 138, 21) Global $Label1 = GUICtrlCreateLabel("Username", 48, 47, 52, 17) Global $Label2 = GUICtrlCreateLabel("Password", 49, 92, 50, 17) Global $Login = GUICtrlCreateButton("Login", 174, 147, 107, 26) Global $Clear = GUICtrlCreateButton("Clear", 30, 147, 107, 26) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Login Login() EndSwitch WEnd Func Login() Global $username = "1234" Global $password = "5678" WinActivate("Untitled: Notepad", "") ; Send($username) Sleep(10) Send("{TAB}") Sleep(10) Send($password) Sleep(10) Send("{ENTER}") endfunc
FrancescoDiMuro Posted March 1, 2019 Posted March 1, 2019 @Kikileu Take a look at _IE* functions in the Help file Click here to see my signature: Reveal hidden contents ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Kikileu Posted March 1, 2019 Author Posted March 1, 2019 On 3/1/2019 at 5:55 AM, FrancescoDiMuro said: @Kikileu Take a look at _IE* functions in the Help file Expand can you be more specific?, also I dont use IE
Nine Posted March 1, 2019 Posted March 1, 2019 If I understand you correctly, you want to send the content of Input1 and Input2 to some windows ? (in your example it is notepad) Right ? But you don't know how to read those 2 fields ? “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Kikileu Posted March 1, 2019 Author Posted March 1, 2019 On 3/1/2019 at 4:26 PM, Nine said: If I understand you correctly, you want to send the content of Input1 and Input2 to some windows ? (in your example it is notepad) Right ? But you don't know how to read those 2 fields ? Expand Yes, exactly
Nine Posted March 1, 2019 Posted March 1, 2019 On 3/1/2019 at 4:38 PM, Kikileu said: Yes, exactly Expand Look at GUICtrlRead ( controlID [, advanced = 0] ) Use it in your Func Login () “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Kikileu Posted March 1, 2019 Author Posted March 1, 2019 On 3/1/2019 at 4:38 PM, Kikileu said: Yes, exactly Expand 43/5000 I need to read and edit the input box 1y 2, I dont know how to explain me better.
Nine Posted March 1, 2019 Posted March 1, 2019 Dude cool down. I just told you how. And BTW do not use global vars in func unless you understand totally what you are doing. Use Local instead. “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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