Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. AutoItSetOption("WinTitleMatchMode", 2)
  2.  
  3. $handle = WinGetHandle("[CLASS:Chrome_WindowImpl_0; TITLE:Getting the current chrome url]")
  4.  
  5. If @error Then
  6. MsgBox(4096, "Error", "Could not find the correct window")
  7. Else
  8. ; alert the present url
  9. MsgBox(4096, "", ControlgetText($handle, "", "Chrome_AutocompleteEditView1" ))
  10.  
  11. ;n redirect the browser
  12. ControlSetText ($handle, "", "Chrome_AutocompleteEditView1", "http://alterlife.org/")
  13. ControlSend ($handle, "", "Chrome_AutocompleteEditView1", "{enter}")
  14. MsgBox(4096, "Error", "The browser has been redirected to http://alterlife.org/.")
  15. EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement