autohotkey - 使用剪贴板进行搜索查询时在浏览器中失去焦点 [autohotkey]
问题描述
我正在使用一个简单的脚本来使用热键运行 google/wikipedia/etc 搜索,不幸的是,在搜索结果出现在新选项卡中后,我必须单击,因为选项卡不是焦点,尽管浏览器窗口是焦点。我试图添加一个 WinActivate 但它不起作用。在安装新的操作系统之前,此脚本曾经按预期工作。为什么这个脚本会让浏览器失去焦点?
这是脚本
^+g::
{
Send, ^c
sleep 200
Run, https://www.google.com/search?hl=en&q=%Clipboard%
sleep 50
WinActivate, ahk_exe waterfox.exe
}
Return
解决方案
我不知道为什么,但看起来增加 Run 和 WinActivate 之间的延迟似乎可以解决它。
^+g::
{
Send, ^c
sleep 200
Run, https://www.google.com/search?hl=en&q=%Clipboard%
sleep 500 ;Up from 50, you might be able to fine-tune this number based on your computer's speed
WinActivate, ahk_exe waterfox.exe
}
推荐阅读
- javascript - 尝试使用 Node.js 传递键值对的 EJS 参考错误
- intellij-idea - IntelliJ IDEA 2020.1(终极版)挂了我的Ubuntu 18.04 LTS
- spring - 在使用 @DataJpaTest 时更改 Spring Boot 测试中的刷新模式?
- java - 抽象异常类中的串行版本 uid
- python - 我的 PhotoImage 没有显示在我的窗口中
- unix - sed - 在第一次匹配之前从文件中插入部分
- python - 删除除百分比外的所有括号内的文字
- sql - 如何计算此 sql 查询中为唯一 ID 返回的行数?
- html - 页框已损坏
- c++ - 用二维字符数组的内容填充字符串的 C++ 向量:大小太大时失败