Jump to content
Sign in to follow this  
andrew.arnott

Address Bar Text

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)  
WinWaitActive ( "Internet Explorer" )
$text = ControlGetText ( "Internet Explorer", "", 41477 )
  MsgBox(0, "", $text)

Share this post


Link to post
Share on other sites

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)

:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...