Jamen Posted May 23, 2015 Share Posted May 23, 2015 OK, I know there has to be a way to do this but for the life of me, I haven't been able to figure it out and I have been working on it all day. First, this application needs to be non-browser specific (so the _IE modules are out). Second, I have been able to check the active window to make sure the user is where they are supposed to be when they launch this application. But on that page they are supposed to be on is a HTML address form that already has data. I need to copy all of that data, store it, and paste it into another website. Now I have used AutoIT years ago and it worked beautifully, but the past few years, I haven't touched it so I am rusty. I tried using the recorder, but that gave me coordinates and I know that's not going to work. Could someone please point me in the right direction? Here's what I have so far (my several failed attempts have been commented out): expandcollapse popup; change WinTitleMatchMode default from 1 (match title from start) to 2 (match any substring) Opt("WinTitleMatchMode", 2) #include <MsgBoxConstants.au3> #include <IE.au3> #Include <WinAPI.au3> HotKeySet ('!x','_Exit'); Alt+Esc = Exit ;HotKeySet ('!c','_Clip'); Alt+c = copy ;HotKeySet ('!v','_Paste'); Alt+v = paste HotKeySet ('!a','_Activate'); Alt+a = activate While '1' Sleep ('100'); Makes CPU usage 0% WEnd Func _Activate () If WinActive("Sales Record") Then MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "The correct window is active.") Local $sText = WinGetText("[ACTIVE]") ; Display the window text. MsgBox($MB_SYSTEMMODAL, "", $sText) ;Local $oIE = _IEAttach("Sales Record") $hWnd = WinGetHandle("[ACTIVE]", "") ;MsgBox($MB_SYSTEMMODAL, "", $hWnd) ;_WinAPI_SetFocus( $hWnd ) ;ControlFocus($hWnd, "", "buyercontactname") ;MsgBox(64, "", $hWnd) ;Local $oInputs = _IETagNameGetCollection($oIE, "input") ;For $oInput In $oInputs ;MsgBox(64, oInput.name) ;MsgBox(64, oInput.value) ;if $oInput.name == "fsubmit" And $oInput.value == "Return to Login Page" Then ; your code here ;Endif ;Next Else MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "You have the incorrect window active.") EndIf EndFunc Func _Exit () Exit EndFunc Link to comment Share on other sites More sharing options...
Danp2 Posted May 23, 2015 Share Posted May 23, 2015 Have you looked at the IUIAutomation thread? Perhaps you can build a solution with it that would be browser independent. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
JohnOne Posted May 23, 2015 Share Posted May 23, 2015 Even with IUIAutomation, OP will need to write different code for every browser I believe.Perhaps WinHttp might be better suited. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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