gpt4 book ai didi

google-chrome - 识别 Chrome 网页

转载 作者:行者123 更新时间:2023-12-02 01:57:12 24 4
gpt4 key购买 nike

我想看看我是否有事件的 Chrome,但不是在其他网页而是在特定页面。

如果我用

IfWinExist ahk_class Chrome_WidgetWin_1

该脚本会发现同时打开了其他网页的 Chrome,我不希望这样。

我该怎么办?

最佳答案

我不确定我是否完全理解您想要实现的目标,但我曾经写过一个脚本来遍历所有 Chrome 选项卡,这里稍作调整,因此它将遍历所有选项卡并激活您想要的选项卡:

^!Space::
{
IsSiteOpen()
return
}

IsSiteOpen()
{
Global TabTitleExist
TabTitle = autohotkey
SetTitleMatchMode 2
IfWinExist, %TabTitle%
{
WinActivate, %TabTitle%
WinMinimize, %TabTitle%
MsgBox, 64, %TabTitle%, It is open
return
}

LoopChromeTabs(TabTitle)
if (TabTitleExist = 1)
{
WinActivate, %TabTitle%
WinMinimize, %TabTitle%
MsgBox, 64, %TabTitle%, It is open
return
}
return
}


LoopChromeTabs(TabTitle)
{
Global TabTitleExist
IfWinExist, ahk_class Chrome_WidgetWin_1
{
; Get current open tab title
WinGetTitle, FirstTitle

; Go through all open tabs and find the tab we are looking for or quit
Loop
{
WinActivate ahk_class Chrome_WidgetWin_1
Send ^{Tab}
WinGetTitle, CurrentTitle

; After we changed tab have we found our tab?
IfWinExist, %TabTitle%
{
TabTitleExist = 1
break
}

; We went through all tabs and we should stop there
If (FirstTitle = CurrentTitle)
break
}
}
}

https://github.com/ilirb/ahk-scripts/blob/master/executable/source/GoogleMusicRemote.ahk

关于google-chrome - 识别 Chrome 网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19350814/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com