Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard Shortcut - Go to the Next Page in Google Search Results
#1
Lightbulb 
If you use Google Search a lot, scrolling and clicking to bring up the next page of results can be a real pain. Using the "Run AutoHotkey code" command in ShortKeeper (with the following script) will allow you to easily create a keyboard shortcut to do this without having to use your mouse.

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!
LastTitleMatchMode := A_TitleMatchMode
SetTitleMatchMode 2
if WinActive("Google Search")
{
  Send ^l
  Sleep 200
  SendInput javascript: document.getElementById("pnnext").click()
  Sleep 200
  Send {enter}
}
SetTitleMatchMode %LastTitleMatchMode%

This script was successfully tested on May 21, 2021 with Edge, Chrome, and Internet Explorer (IE).

The instructions to go to the next page (lines #5 to #9) will be executed only if the active window title includes "Google Search".

If ever Google changes the way its search webpage works, this script may stop working. Please report any problems here. This will allow someone to correct the script. Just subscribe to this thread to be notified of any updates.
Enterpad: For those who need more than a few shortcuts.

Reply
#2
Lightbulb 
Hello denilama,

I found your AHK script quite useful! Basing on yours, here's a slight modification which can potentially speedup 200ms:

Code:
LastTitleMatchMode := A_TitleMatchMode
SetTitleMatchMode 2
if WinActive("Google Search")
    Send ^l
    Sleep 200
    SendInput javascript:document.getElementById("pnnext").click()`n
}
SetTitleMatchMode %LastTitleMatchMode%

In addition, non-English users (for example Chinese) have to change to RegEx matching mode to make it work:

Code:
SetTitleMatchMode RegEx
if WinActive("Google\s\x{641c}\x{5c0b}") {  ; "Google 搜尋"
; or WinActive("Google\s\x{641c}\x{5bfb}")  ; "Google 搜寻"

Cheers,
davidhcefx
Reply
#3
Thank you davidhcefx for the improved code.
Enterpad: For those who need more than a few shortcuts.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)