MattAlter Posted May 13, 2014 Share Posted May 13, 2014 (edited) Hi. I have an Excel macro that I already clikced with autoit. Now I need to complete the input window. I am trying with control send but its not working ControlSend("Sign into Office 365", "", "usernameTextBox", "usernameHere") I have tried variations on class name, still now luck WindowsForms10.EDIT.app.0.190610d_r81_ad22 usernameTextBox [NAME:usernameTextBox] WindowsForms10.EDIT.app.0.190610d_r81_ad2 Here is the spy output expandcollapse popup>>>> Window <<<< Title: Sign into Office 365 Class: WindowsForms10.Window.8.app.0.190610d_r84_ad2 Position: 603, 334 Size: 393, 201 Style: 0x16C30000 ExStyle: 0x00050101 Handle: 0x003305BE >>>> Control <<<< Class: WindowsForms10.EDIT.app.0.190610d_r84_ad2 Instance: 2 ClassnameNN: WindowsForms10.EDIT.app.0.190610d_r84_ad22 Name: usernameTextBox Advanced (Class): [NAME:usernameTextBox] ID: 2035604 Text: Position: 15, 54 Size: 357, 23 ControlClick Coords: 81, 9 Style: 0x560100C0 ExStyle: 0x00000200 Handle: 0x001F0F94 >>>> Mouse <<<< Position: 702, 422 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Enter your credentials to sign into Office 365 Cancel Login Password: User ID: >>>> Hidden Text <<<< I am getting exit code 0. Any suggestions? Thanks Matt Edited May 13, 2014 by MattAlter Link to comment Share on other sites More sharing options...
Jfish Posted May 13, 2014 Share Posted May 13, 2014 If you are having trouble identifying the control you may want to look at this thread: '?do=embed' frameborder='0' data-embedContent>> Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
jdelaney Posted May 13, 2014 Share Posted May 13, 2014 (edited) Try this: ; window is already expected to be opened, and active ControlSend("Sign into Office 365", "", "[NAME:usernameTextBox]", "usernameHere") Edited May 13, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
MattAlter Posted May 13, 2014 Author Share Posted May 13, 2014 Try this: ; window is already expected to be opened, and active ControlSend("Sign into Office 365", "", "[NAME:usernameTextBox]", "usernameHere") No dice. Link to comment Share on other sites More sharing options...
jdelaney Posted May 13, 2014 Share Posted May 13, 2014 (edited) Try this...let's see where it's failing...send back output $hWnd = WinGetHandle("Sign into Office 365") If IsHWnd($hWnd) Then ConsoleWrite("found window" & @CRLF) WinActivate($hWnd) Else ConsoleWrite("could not find window" & @CRLF) Exit 0 EndIf $hControl = ControlGetHandle($hWnd, "", "[NAME:usernameTextBox]") If IsHWnd($hControl) Then ConsoleWrite("found control" & @CRLF) Else ConsoleWrite("could not find control" & @CRLF) Exit 0 EndIf ControlFocus($hWnd, "", $hControl) ControlSetText($hWnd, "", $hControl,"usernameHere") Edited May 13, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
MattAlter Posted May 13, 2014 Author Share Posted May 13, 2014 This works Send("username{TAB}password") But, I have special charters in the passwords and it is not picking it up. I have tried putting in in quotes and no go. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 13, 2014 Developers Share Posted May 13, 2014 Send("username{TAB}password",1) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Unc3nZureD Posted May 13, 2014 Share Posted May 13, 2014 Send("username{TAB}password",1) Jos Will that code send the TAB button? I think it will type it i think you need to divide it two way. 1st: Send("username{TAB}") 2nd: Send("p@ssw{}ord", 1) Link to comment Share on other sites More sharing options...
jdelaney Posted May 13, 2014 Share Posted May 13, 2014 Sends are unreliable. I'd work on debugging what's wrong with the controlsettext. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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