这是基于 Darka 评论的 AutoHotkey 脚本:
版本 1:
SetTitleMatchMode, 2
WinActivate, Google Chrome
CheckChromeWindow:
IfWinActive, Google Chrome
{
Send, ^h
}
else
{
Goto, CheckChromeWindow
}
CheckHistoryPage:
IfWinActive, History - Google Chrome
{
Send, {Tab 4}
Send, {Enter}
}
else
{
Goto, CheckHistoryPage
}
编辑:
第 2 版:
SetTitleMatchMode, 2
WinActivate, Google Chrome
CheckChromeWindow:
IfWinActive, Google Chrome
{
Send, ^h
}
else
{
Goto, CheckChromeWindow
}
CheckHistoryPage:
IfWinActive, History - Google Chrome
{
Send, {Tab 5}
Send, {Enter}
}
else
{
Goto, CheckHistoryPage
}
第 3 版:
SetTitleMatchMode, 2
WinActivate, Google Chrome
CheckChromeWindow:
IfWinActive, Google Chrome
{
Send, ^h
}
else
{
Goto, CheckChromeWindow
}
CheckHistoryPage:
IfWinActive, History - Google Chrome
{
Send, {Tab 4}
Send, {Enter}
Send, {Tab}
Send, {Enter}
}
else
{
Goto, CheckHistoryPage
}
如果您想使用热键运行该代码(在我们的例子中是 CTRL+Alt+z)然后将上面的代码放在 ;some code 的位置在 pu 所有代码放在脚本末尾之后:
return
!^z::
;some code
return
另外,请始终使用来自 http://ahkscript.org/ 的 AutoHotkey 及其文档(当前最新版本,新官网)! AutoHotkey 及其来自 autohotkey.com 的文档已过时,您在使用它们时可能会遇到一些问题!