ahk是熱鍵腳本文件擴展名的一種,編寫ahk文件使用的腳本語言是autohotkey。autohotkey通過把常用的鍵盤鼠標操作編寫成腳本語句來動態(tài)調用的方式避免了每次手動輸入的重復操作,提高了使用計算機的工作效率。
;Author:?
;date: 2015-11-20 10:08:56
#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
Activate(t)
{
IfWinActive,%t%
{
WinMinimize
return
}
SetTitleMatchMode 2
DetectHiddenWindows,on
IfWinExist,%t%
{
WinShow
WinActivate
return 1
}
return 0
}
ActivateAndOpen(t,p)
{
if Activate(t)==0
{
Run %p%
WinActivate
return
}
}
; win+o啟動outlook郵箱
#o::ActivateAndOpen("Microsoft Outlook","outlook.exe")
#1::Activate("Microsoft Outlook")
#f::ActivateAndOpen("Foxit Reader","C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe")
#2::Activate("Foxit Reader")
#c::ActivateAndOpen("Google Chrome","C:\Program Files\Google\Chrome\Application\chrome.exe")
#3::Activate("Google Chrome")
#s::ActivateAndOpen("Xshell","D:\software-installpackage\xshell_xftp\Xshell_4.0.0128_Xftp_4.0.0110_PortableSoft\XshellXftpPortable\XshellPortable.exe")
#4::Activate("Xshell")
#w::ActivateAndOpen("notes","C:\Program Files\Notes\notes.exe")
#5::Activate("notes")
; win+p 啟動記事本
#p::ActivateAndOpen("Notepad++","Notepad++.exe")
#6::Activate("Notepad++")
#q::ActivateAndOpen("nyfedit","D:\software-installpackage\myBase_Desktop_6.20\nyfedit.exe")
#7::Activate("nyfedit")
;win+j 啟動金山詞霸
#j::ActivateAndOpen("XDict","C:\Program Files\Kingsoft\PowerWord_cut\XDict.exe")
#8::Activate("XDict")
#x::ActivateAndOpen("XMind","D:\software\XMind\XMind.exe")
#9::Activate("XMind")
;#e::ActivateAndOpen("eclipse.exe","D:\eclipse\eclipse.exe")
;#-::Activate("eclipse.exe")
; win+g 啟動google瀏覽器
;#g::Run "C:\Program Files\Google\Chrome\Application\chrome.exe"
;#b::Run www.baidu.com
;#g::Run www.google.com.hk
;win+方向鍵左箭頭;;表示窗口向左放置
;win+方向鍵右箭頭;;表示窗口向右放置
;win+方向鍵上箭頭;;表示窗口最大化
;win+方向鍵下箭頭;;表示窗口窗口化;再次win+方向下箭頭;;表示窗口最小化
WinStatus:=0
;ctrl+m 最大化、窗口化當前窗口
;^m::
;
;if WinStatus=0
;
;{
;
;? ? WinMaximize , A
;
;? ? WinStatus:=1
;
;}
;
;else
;
;{
;
;? ? WinRestore ,A
;
;? ? WinStatus:=0
;
;}
;
;return
;輸入/dd
;然后摁enter 表示輸入時間
::/dd::
d = %A_YYYY%-%A_MM%-%A_DD% %A_Hour%:%A_Min%:%A_Sec%
clipboard = %d%
Send ^v
return
::/ss::
d = %A_YYYY%-%A_MM%-%A_DD% %A_DDDD%
clipboard = %d%
Send ^v
return
::/zqh::鄭泉海
;win +鼠標中鍵 關閉窗口
#MButton::
SendInput !{F4}
Return
; 選取文本后按〔win+G〕執(zhí)行 Google 搜尋
#g::
current_clipboard = %Clipboard% ; 把目前的剪貼板內容存起來供后面還原
Clipboard = ; 先把剪貼板清空
Send ^c
; 把選取字串用〔Ctrl+C〕存入剪貼板
ClipWait, 1 ; 等待 1 秒讓剪貼板執(zhí)行存入動作
; 下行使用 Google 執(zhí)行搜尋動作,要搜尋的字串就是剪貼板內容
Run http://www.google.com.hk/search?hl=zh-TW&q=%Clipboard%
Clipboard = %current_clipboard% ; 還原先前的剪貼板內容
return
; 選取文本后按〔Win+b〕執(zhí)行 baidu 搜尋
#b::
current_clipboard = %Clipboard% ; 把目前的剪貼板內容存起來供后面還原
Clipboard = ; 先把剪貼板清空
Send ^c
; 把選取字串用〔Ctrl+C〕存入剪貼板
ClipWait, 1 ; 等待 1 秒讓剪貼板執(zhí)行存入動作
; 下行使用 Google 執(zhí)行搜尋動作,要搜尋的字串就是剪貼板內容
Run https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=0&rsv_idx=1&tn=baidu&wd=%Clipboard%
Clipboard = %current_clipboard% ; 還原先前的剪貼板內容
return
;#1::
;run, http://mail.163.com
;WinWaitActive, 網(wǎng)易 ;;等待網(wǎng)頁加載成功(至少title顯示出來)
;sleep, 1000 ;;保險起見,再等1秒(視網(wǎng)速而定)
;send, user-id{tab}password{enter};;模擬鍵入用戶名、密碼、回車
;return
;按F9鍵停止所有熱鍵
F9::suspend