需求:想为Edge浏览器设置一个打开扩展的快捷键,基本逻辑就是选中地址栏→输入“edge://extensions/”→回车;可是一直没有找到能直接复制指定文字的办法,奈何百度一直都没有相关的小工具,原本还想着CMD命令来运行python实现,都不成功,突然发现强大的AHK命令,是可以实现这一操作的。
:*:reg::
clipboard = regedit
send,^v
return
^+!e::
clipboard = edge://extensions/
send,^v
return
通过快捷键,发送指定的文本到剪切板,还能直接粘贴,真的太强了!!上面那段是文字补全功能,自动补全regedit,打开注册表常用。
拓展
复制指定文字并搜索
!g:: ;
:*:ggg:: ;
clipboard = ; 清空剪贴板
send,{shiftdown}{left}{right}{shiftup} ;固定选中目标
send,^c
send, {end}
run https://www.google.com/search?q=%clipboard% ;用google搜索剪切板的内容
tooltip, 打开google
sleep 1500
tooltip,
return
!b:: ;
:*:bbb:: ;
clipboard =
send,{shiftdown}{left}{right}{shiftup}
send,^c
send, {end}
run http://www.baidu.com/s?wd=%clipboard%
tooltip, 打开baidu
sleep 1500
tooltip,
return
;;打开网址
!u::
send,^c
if(InStr(Clipboard, "http")){
judgeActivate("Edge","msedge")
run %Clipboard%
}
return
指定程序执行快捷键
;指定程序wps运行
#IfWinActive ahk_exe wps.exe
^-::^F11
return
#IfWinActive