原文请移步:Win下最爱效率神器:AutoHotKey
自己的键值设置,只为日后方便增加快捷键
这里简单说明下脚本中常用符号代表的含义:
# 号代表 Win 键;
! 号代表 Alt 键;
^ 号代表 Ctrl 键;
+ 号代表 shift 键;
:: 号(两个英文冒号)起分隔作用;
run,非常常用 的 AHK 命令之一;
; 号代表 注释后面一行内容;
!j::Run https://www.baidu.com/
!b::Run https://blog.csdn.net/qq_20984609/
!r::Run F:\cmder\Cmder.exe
#m::Run D:\Navicat Premium\navicat.exe
;切换chrom浏览器
#c::
IfWinNotExist ahk_class Chrome_WidgetWin_1
{
Run "C:\Users\yuanlei\AppData\Local\Google\Chrome\Application\chrome.exe"
WinActivate
}
Else IfWinNotActive ahk_class Chrome_WidgetWin_1
{
WinActivate
}
Else
{
WinMinimize
}
Return
; Ctrl+Shift+f 在当前目录打开cmder
$^+f::
Process,Exist,explorer.exe
if (%ErrorLevel% != 0){
if WinActive("ahk_class CabinetWClass"){
path := getExplorerPath()
Run ,cmder "%path%"
return
} ; 如果在桌面
if WinActive("ahk_class WorkerW"){
Run ,cmder %A_Desktop%
return
}
}
; 获取当前路径的函数
getExplorerPath(){
IfWinExist, ahk_class CabinetWClass
{
ControlGetText,address,ToolbarWindow323,ahk_class CabinetWClass
StringLen, length, address
StringRight, path, address, length-4
return path
}
return
}