Autohotkey介紹

来源:互联网 发布:大数据书籍推荐知乎 编辑:程序博客网 时间:2024/04/24 09:47

Autohotkey介紹

AHK就是AutoHotKey,是一款免费的、Windows平台下开放源代码的热键脚本语言。
可以模擬鼠標、鍵盤等實現自動運行。
自动图形界面脚本生成工具(SmartGUI Creator 4.0)

AHK

AHK官網:http://www.autohotkey.com/
AHK下載:http://ahkscript.org/download/

AHK基本操作

基本操作

使用notepad文本编辑器,新建一个文件,使用.ahk作为后缀名,例如test.ahk 。

代码:

MsgBox,hello,worldrun,https://www.baidu.com

效果:出現hello,world提示框,點擊OK

    自動打開www.baidu.com

明:

  (1).保存退出,双击执行

  (2).可以Compile Script成.exe文件,移植其他幾台運行。

  (3).還可以實現自動登錄

鍵實例介紹

l作業要求:

自動打開或關閉Automatically restart

l實現過程:
Ø1.運行CMD打開系統設置
Ø2.autohotkey模擬按鍵
l說明:
Ø管理員模式運行,否則不能

模擬按鍵所以.ahk文件不能直接運

行。解決辦法:編譯成.exe可執行文

件再以管理員模式運行。

code:

SetTitleMatchMode 2run,cmdWinWait, ahk_class ahk_class ConsoleWindowClass,IfWinNotActive, ahk_class ConsoleWindowClass, , WinActivate, ahk_class ConsoleWindowClass,WinWaitActive, ahk_class ConsoleWindowClass,ControlSend, , Control sysdm.cpl`,`,3 {Enter}, cmd.exe WinWait,  ahk_class #32770,IfWinNotActive,  ahk_class #32770, , WinActivate,  ahk_class #32770,WinWaitActive, ahk_class #32770,send {TAB} send {TAB}send {Enter} send {TAB}send {TAB}send {TAB}send {TAB}send {TAB}send {SPACE}send {TAB}send {TAB}send {TAB}send {TAB}send {Enter} 



0 0
原创粉丝点击