gpt4 book ai didi

autohotkey - 如何将 AutoHotKey 代码设置为仅在 chrome 中运行?

转载 作者:行者123 更新时间:2023-12-02 17:09:12 25 4
gpt4 key购买 nike

我想在 Chrome 中双击一个单词时模拟“查找”操作。

我已经做到了:

~LButton::
SetTitleMatchMode, 2
#IfWinActive, ahk_class Chrome
If (A_TimeSincePriorHotkey<400) and (A_TimeSincePriorHotkey<>-1)
{
SendInput ^c
Sleep, 10
SendInput ^f
Sleep, 10
SendInput ^v
}

Return

但它甚至在非 chrome 进程中运行(当双击一个词时)

问题:

如何让这个脚本仅在双击 chrome 时运行?

最佳答案

#IfWinActive, ahk_exe Chrome.exe ;; start of IfWinActive condition, for me it didn't work with ahk_class so i changed it to ahk_exe
~LButton::
SetTitleMatchMode, 2
If (A_TimeSincePriorHotkey<400) and (A_TimeSincePriorHotkey<>-1)
{
SendInput ^c
Sleep, 10
SendInput ^f
Sleep, 10
SendInput ^v
}
Return

~RButton::
SendInput {Escape}
Return
#IfWinActive ;; end of condition IfWinActive

关于autohotkey - 如何将 AutoHotKey 代码设置为仅在 chrome 中运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50179972/

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