Alterlife Posted February 5, 2010 Share Posted February 5, 2010 I have a chrome window open. I need to be able to attach to it and get the current URL being browsed, I also need to be able redirect the browser to another URL. How would I go about doing this? Link to comment Share on other sites More sharing options...
Alterlife Posted February 5, 2010 Author Share Posted February 5, 2010 Success :-) AutoItSetOption("WinTitleMatchMode", 2) $handle = WinGetHandle("[CLASS:Chrome_WindowImpl_0; TITLE:Getting the current chrome url]") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ; alert the present url MsgBox(4096, "", ControlgetText($handle, "", "Chrome_AutocompleteEditView1" )) ;n redirect the browser ControlSetText ($handle, "", "Chrome_AutocompleteEditView1", "http://alterlife.org/") ControlSend ($handle, "", "Chrome_AutocompleteEditView1", "{enter}") MsgBox(4096, "Error", "The browser has been redirected to http://alterlife.org/.") EndIf guestscripter 1 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