Internet Explorer: focus input field - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=59571
- I noticed in the last few days that this line of code, that had worked for a long time on Google, now only works on the Google home page, and no longer works on search result pages.
oWB.document.getElementById("lst-ib").focus()
- Here's a fix.
Code: Select all
;WBGet function - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=39869
^#f:: ;internet explorer - focus input field
WinGet, hWnd, ID, A
oWB := WBGet("ahk_id " hWnd)
vUrl := oWB.document.url
;vTitle := oWB.document.title
;oElt := oWB.document.activeElement
;MsgBox, % Format("id: {}`r`n" "tag: {}`r`n" "class: {}", oElt.id, oElt.tagName, oElt.className)
;oElt := ""
if InStr(vUrl, ".google.")
{
if IsObject(oWB.document.getElementById("lst-ib"))
oWB.document.getElementById("lst-ib").focus()
else
oWB.document.getElementsByTagName("input").1.focus()
}
oWB := ""
return