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 

猜你喜欢

转载自www.cnblogs.com/zjfree/p/10028064.html