-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautohotkey.ahk
80 lines (66 loc) · 3.06 KB
/
autohotkey.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ;Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ;Ensures a consistent starting directory.
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 0
; 如果软件没打开,则打开软件;如果软件已打开则置顶软件,如果软件已被置顶,则隐藏软件
ActivateAndOpen(t,p)
{
IfWinNotExist,ahk_exe %t%
Run, %p%
Else
{
IfWinActive, ahk_exe %t%
WinMinimize
Else
WinActivate,
}
return 0
}
; 一键打开所有软件
OpenAll()
{
IfWinNotExist,ahk_exe "Xshell.exe"
Run, "C:\Program Files (x86)\NetSarang\Xshell 7\Xshell.exe"
IfWinNotExist,ahk_exe "SecureCRT.exe"
Run, "C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe"
IfWinNotExist,ahk_exe "WXWork.exe"
Run, "C:\Program Files (x86)\WXWork\WXWork.exe"
IfWinNotExist,ahk_exe "atom.exe"
Run, "C:\Users\lkong\AppData\Local\atom\app-1.43.0\atom.exe"
IfWinNotExist,ahk_exe "chrome.exe"
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
IfWinNotExist,ahk_exe "TOTALCMD64.EXE"
Run, "C:\Program Files\totalcmd\TOTALCMD64.EXE"
}
; 发送文本 t 到粘贴板
SendToClipBoard(t)
{
;清空剪切板
clipboard =
clipboard = %t%
return 0
}
; 绑定热键
!\::OpenAll()
!e::ActivateAndOpen("Xshell.exe","C:\Program Files (x86)\NetSarang\Xshell 7\Xshell.exe")
!w::ActivateAndOpen("SecureCRT.exe","C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe")
#s::ActivateAndOpen("WeChat.exe","C:\Program Files (x86)\Tencent\WeChat\WeChat.exe")
!r::ActivateAndOpen("WXWork.exe","C:\Program Files (x86)\WXWork\WXWork.exe")
#k::ActivateAndOpen("QQ.exe","C:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe")
!t::ActivateAndOpen("Insomnia.exe","C:\Users\lkong\AppData\Local\insomnia\app-7.1.1\Insomnia.exe")
!d::ActivateAndOpen("POWERPNT.EXE","C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE")
!g::ActivateAndOpen("WINWORD.EXE","C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE")
!h::ActivateAndOpen("EXCEL.EXE","C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE")
#v::ActivateAndOpen("VISIO.EXE","C:\Program Files (x86)\Microsoft Office\root\Office16\VISIO.EXE")
!p::ActivateAndOpen("SumatraPDF.exe","C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SumatraPDF")
#v::ActivateAndOpen("i_view32.exe","C:\Program Files (x86)\IrfanView\i_view32.exe")
#e::ActivateAndOpen("atom.exe","C:\Users\lkong\AppData\Local\atom\app-1.43.0\atom.exe")
!a::ActivateAndOpen("MySQLWorkbench.exe","C:\Program Files\MySQL\MySQL Workbench 8.0 CE\MySQLWorkbench.exe")
#f::ActivateAndOpen("firefox.exe","C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
!q::ActivateAndOpen("TOTALCMD64.EXE","C:\Program Files\totalcmd\TOTALCMD64.EXE")
!f::ActivateAndOpen("chrome.exe","C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
;粘贴板
#0::SendToClipBoard("your@password")
#9::SendToClipBoard("your@password2")