AutoHotkey 自動化腳本工具實例


AHK 自動按鍵工具

https://www.autohotkey.com/

可實現功能

  • 快捷鍵 啟動 瀏覽器、CMD命令、彈出框
  • 可定時執行任務
  • 可改鍵 將A與B互換
  • 可快捷替換字符串

測試如下:

; AutoHotkey 簡單實用說明 2018-11-27 by zjfree
; 快捷鍵說明 # Win, ! alt, ^ control, + shift

; 僅允許運行一個
#SingleInstance

; 定時器 lastNow 保證必然執行
#Persistent
lastNow = 0
SetTimer, autoTimer, 30000
Return
autoTimer:
FormatTime, now,, yyyyMMdd HH:mm
FormatTime, HHmm,, HH:mm
if (lastNow == now)
    Return
lastNow = %now%
IfEqual, HHmm, 08:30, Msgbox,0,提醒,上班了,5
IfEqual, HHmm, 12:00, Msgbox,0,提醒,吃飯嘍,5
IfEqual, HHmm, 18:00, Msgbox,0,提醒,下班了,5
IfEqual, now, 20181128 09:00, Msgbox,0,提醒,2018-11-28 定時提醒,5
Return

; 【WIN+B】打開百度網站
#b::run www.baidu.com

; 【WIN+C】打開計算器
#c::run calc

; 【WIN+N】打開記事本
#n::
run notepad
sleep 200
send {F5}{Enter}{Enter}
return

; 【WIN+K】開關鍵 1秒輸入一個a
#k:: 
if ONOFF := !ONOFF 
    SetTimer, KeyPress, 1000 
else 
    SetTimer, KeyPress, Off 
Return 
KeyPress: 
Send, a 
Return

; 【Win+P】 會暫停腳本. 再按一次則取消暫停.
#p::Pause 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM