Chrome focus address bar bug.

Get help with using AutoHotkey and its commands and hotkeys
Posts: 11
Joined: 25 Jul 2018, 14:36

Chrome focus address bar bug.

31 Jul 2018, 23:04


Anyone can tell me why sometime AHK does not focus on Chrome address bar?
If I add a loop with the below code, most of the time it work but sometime it does not focus...

Code: Select all

Pathx = %A_Scriptdir%\URL.xlsx

Xl := ComObjCreate("Excel.Application") 				        ;create a handle to a new excel application
Xl_Workbook := Xl.Workbooks.Open(Pathx) 			;open an existing file
code:= ThisRow[8] ; variable that we look into the excel file for the url
x := xl.Range("A:A").Find(code).row
found := xl.Range("B" x).text

sleep, 150
WinActivate, ahk_exe chrome.exe
sleep, 250
Send ^l ; this is the shortcut for focusing on the address bar
Sleep 500 ; give just a bit of time for Chrome to respond
Clipboard := Found ; url found in the excel file
Send ^v ; paste url into the address bar
sleep, 250
Send, {ENTER}

msgbox, this is a message to stop the loop and verify if it really focus each time.

Xl_Workbook.Close(0)                                                            ;closes but does not save 

User avatar
Posts: 344
Joined: 24 Aug 2015, 12:56
Google: [email protected]
GitHub: YoucefHam
Location: Algeria

Re: Chrome focus address bar bug.

01 Aug 2018, 09:41

try using "F6" key

send, {F6}
:wave: There is always more than one way to solve a problem. ;)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], djuga, Google [Bot], Jimay, tt_1111, Xeo786 and 52 guests