andrew.arnott Posted April 19, 2005 Posted April 19, 2005 I looked through the forum and the manual, but I couldn't find an answer to this. How can I get the text from the adress bar in an internet explorer window? The control ID is 41447. Thanks, aarnott
Micha1405 Posted April 19, 2005 Posted April 19, 2005 Try this Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced $text = WinGetTitle("AutoIt Forums -","") MsgBox(0, "Text read was:", $text) My TrayToolBar
andrew.arnott Posted April 19, 2005 Author Posted April 19, 2005 Thanks for taking a look, but that's not exactly what I meant (sorry!). :"> I mean I want to get the text from the address bar where you type in "www.autoitscript.com". I know how to put text into that bar, but the ControlGetText() function doesn't return anything. I'm not sure how to go about this.
Westi Posted April 19, 2005 Posted April 19, 2005 Opt("WinTitleMatchMode", 2) WinWaitActive ( "Internet Explorer" ) $text = ControlGetText ( "Internet Explorer", "", 41477 ) MsgBox(0, "", $text)
andrew.arnott Posted April 19, 2005 Author Posted April 19, 2005 Is it my computer then? That's what I had before, and it doesn't work . It just shows a blank message box, so it is returning nothing.
Westi Posted April 19, 2005 Posted April 19, 2005 It just shows a blank message box, so it is returning nothing.This is not possible 'cause WinWaitActive.Check the ControlID, it is 41477 not 41447 !!!Advanced version:Opt("WinTitleMatchMode", 2) ;VERY IMPORTANT $title = "Internet Explorer" $url = "Address is: " $hwnd = "Handle is: " $hwnd = $hwnd & ControlGetHandle ( $title, "", 41477 ) If $hwnd = "Handle is " then $hwnd = "No such ControlID" Else $url = $url & ControlGetText ( $title, "", 41477 ) EndIf MsgBox(0, $title, $url & @CRLF & $hwnd)
andrew.arnott Posted April 19, 2005 Author Posted April 19, 2005 Thanks!!! (now don't I feel stupid :"> ) It works perfectly -- again thanks a lot!
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