以下是我这几年一直不断优化的,代码简写和片段快捷输入的方式。让你更方便的写AHK代码
搜狗输入法候选演示
搜狗输入法 AHK候选添加方法
搜狗 自定义短语 AHK语法候选文本 20250417更新
; 搜狗输入法--自定义短语配置文件 ; 自定义短语说明: ; 1、自定义短语支持多行、空格、指定位置。 ; 2、每条自定义短语最多支持30000个汉字,总共支持100000条自定义短语。 ; 3、自定义短语的格式如下: ; 单行的格式: ; 字符串+英文逗号+数字(指定排序位置)=短语 ; 多行的格式: ; 字符串+英文逗号+数字(指定排序位置)= ; 多行短语 ; 具体格式可以参考下面的实例。 ; 4、最多支持100000行自定义短语。 ; 5、自定义短语的用途有:快捷输入手机号、邮箱、诗词、小短文等,大家可以自由发挥。 ; 6、时间函数功能。具体定义格式如下:; 字符串+英文逗号+数字(指定排序位置)=#表达式 ; 注意:表达式以英文#开头,后面的表达式中的每一个函数的前面都包含有英文$。 ; 函数表如下: ; 函数 含义 举例 ; $year 年(4位) 2006、2008 ; $year_yy 年(2位) 06、08 ; $month 月 12、8、3 ; $month_mm 月 12、08、03 //此函数在输入法3.1版之后(含)有效 ; $day 日 3、13、22 ; $day_dd 日 03、13、22 //此函数在输入法3.1版之后(含)有效 ; $weekday 星期 0、1、2、5、6 ; $fullhour 时(24小时制) 2、8、13、23 ; $fullhour_hh 时(24小时制) 02、08、13、23 //此函数在输入法3.1版之后(含)有效 ; $halfhour 时(12小时制) 2、8、10、11 ; $halfhour_hh 时(12小时制) 02、08、10、11 //此函数在输入法3.1版之后(含)有效 ; $ampm AM、PM(英) AM、PM(大写) ; $minute 分 02、08、15、28 ; $second 秒 02、08、15、28 ; $year_cn 年(中文4位) 二〇〇六 ; $year_yy_cn 年(中文2位) 〇六 ; $month_cn 月(中文) 十二、八、三 ; $day_cn 日(中文) 三、十三、二十二 ; $weekday_cn 星期(中文) 日、一、二、五、六 ; $fullhour_cn 时(中文24时制) 二、八、十三、二十三 ; $halfhour_cn 时(中文12时制) 二、八、一、十一 ; $ampm_cn 上午下午(中文) 上午、下午 ; $minute_cn 分(中文) 零二、零八、十五、二十八 ; $second_cn 秒(中文) 零二、零八、十五、二十八 ; 具体你可以参考这个文件最下面的例子,实际体验一下就明白了。 ; 你可以用自定义短语来做一个带动态时间的多行回信落款。 ; ss,1=#$year年$month月$day_dd日 $fullhour:$minute:$second a,3=A_ScriptDir a,4=A_ScriptFullPath a,5=A_AhkPath a,6=A_Temp a,7=A_ScreenWidth宽 a,8=A_ScreenHeight高 a,9=A_Index aa,2=A_Args[1] aa,3=A_WorkingDir aa,4=A_ThisLabel aa,5=A_Desktop aa,6=A_ScriptHwnd aa,7=A_AppData aa,8=A_ThisHotkey aa,9=A_IPAddress1 aaa,2=A_GuiControl aaa,3=A_Startup aaa,4=A_PtrSize aaa,5=A_DesktopCommon aaa,6=A_Now aaa,7=A_ScreenDPI/96 ae,3=АΕΣ( aes,3=АΕΣ( ah,2=AutoHotkey ah,3=AHKEditor ahk,2=AutoHotkey ahk,3=ahk_class ahk,4=ahk_id ahk,5=ahk_pid ahk,6=ahk66.com ahk,7=ahk_exe ahk,8=ahk_group ahk,9=ahk_class AHKEditor ahkk,2=AutoHotkey ahkk,3=AHKEditor ajian,3=Alt ajian,4=! ann,3=Gui Add, Button, w80, 按钮名 ann,4=Button anni,3=Gui Add, Button, w80, 按钮名 anni,4=Button anniu,3=Gui Add, Button, w80, 按钮名 anniu,4=Button ar,3=Arduino ard,3=Arduino ardu,3=Arduino ardui,3=Arduino arduin,3=Arduino arduino,3=Arduino b,3=Base64 ba,3=White bai,3=White bais,3=White baise,3=White banb,3= #Requires AutoHotkey v1.1.33+ banbe,3= #Requires AutoHotkey v1.1.33+ banben,3= #Requires AutoHotkey v1.1.33+ bangd,3= Hwnd := WinExist("FindText WinTitle") FindText().BindWindow(Hwnd, 1) bangdi,3= Hwnd := WinExist("FindText WinTitle") FindText().BindWindow(Hwnd, 1) bangdin,3= Hwnd := WinExist("FindText WinTitle") FindText().BindWindow(Hwnd, 1) bangding,3= Hwnd := WinExist("FindText WinTitle") FindText().BindWindow(Hwnd, 1) baoc,3=Throw Exception("报错信息") baoc,4=Try baoc,5=Catch baoc,6= Try { 函数() } Catch e { ; 处理由上面区块产生的首个错误/异常. MsgBox, 抛出了一个异常!`n具体来说就是:%e% ; throw "自定义错误信息" } baoc,7=ERROR baocu,3=Throw Exception("报错信息") baocu,4=Try baocu,5=Catch baocu,6= Try { 函数() } Catch e { ; 处理由上面区块产生的首个错误/异常. MsgBox, 抛出了一个异常!`n具体来说就是:%e% ; throw "自定义错误信息" } baocu,7=ERROR baocuo,3=Throw Exception("报错信息") baocuo,4=Try baocuo,5=Catch baocuo,6= Try { 函数() } Catch e { ; 处理由上面区块产生的首个错误/异常. MsgBox, 抛出了一个异常!`n具体来说就是:%e% ; throw "自定义错误信息" } baocuo,7=ERROR bb,1= #Requires AutoHotkey v1.1.33+ bb,2= #Requires AutoHotkey v2.0 bianl,3=Clipboard := "" bianl,4=Global bianl,5=Static ; init:= bianl,6=local ; 局部变量 bianl,7= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v bianl,8=ByRef bianl,9=value bianli,3=Clipboard := "" bianli,4=Global bianli,5=Static ; init:= bianli,6=local ; 局部变量 bianli,7= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v bianli,8=ByRef bianli,9=value bianlia,3=Clipboard := "" bianlia,4=Global bianlia,5=Static ; init:= bianlia,6=local ; 局部变量 bianlia,7=FileRead, 读取文件到变量, D:\My File.txt bianlia,8=FileReadLine, 指定行_读取文件指定行到变量, D:\ContactList.txt, 12 bianlian,3=Clipboard := "" bianlian,4=Global bianlian,5=Static ; init:= bianlian,6=local ; 局部变量 bianlian,7=FileRead, 读取文件到变量, D:\My File.txt bianlian,8=FileReadLine, 指定行_读取文件指定行到变量, D:\ContactList.txt, 12 bianliang,3=Clipboard := "" bianliang,4=Global bianliang,5=Static ; init:= bianliang,6=local ; 局部变量 bianliang,7=FileRead, 读取文件到变量, D:\My File.txt bianliang,8=FileReadLine, 指定行_读取文件指定行到变量, D:\ContactList.txt, 12 bianj,3=Edit bianji,3=Edit bianm,3=FileEncoding UTF-8 ; 为 FileRead, FileReadLine, Loop Read, FileAppend 和 FileOpen 设置默认编码 bianm,4=UTF-8 bianm,5=CP936 bianm,6=StrReplace(去除UTF8不可见, Chr(0xFEFF)) bianma,3=FileEncoding UTF-8 ; 为 FileRead, FileReadLine, Loop Read, FileAppend 和 FileOpen 设置默认编码 bianma,4=UTF-8 bianma,5=CP936 bianma,6=StrReplace(去除UTF8不可见, Chr(0xFEFF)) biany,3=FileInstall, 打包文件名.exe, -, 1 biany,4=A_IsCompiled bianyi,3=FileInstall, 打包文件名.exe, -, 1 bianyi,4=A_IsCompiled biaog,3=Excel biaoge,3=Excel biaoq,3=Sc956::单行标签写法 biaoq,4=A_ThisLabel biaoq,5=if IsLabel("标签名存在") biaoqi,3=Sc956::单行标签写法 biaoqi,4=A_ThisLabel biaoqi,5=if IsLabel("标签名存在") biaoqia,3=Sc956::单行标签写法 biaoqia,4=A_ThisLabel biaoqia,5=if IsLabel("标签名存在") biaoqian,3=Sc956::单行标签写法 biaoqian,4=A_ThisLabel biaoqian,5=if IsLabel("标签名存在") biaot,3=WinSetTitle, ahk_class HH Parent, , 修改窗口标题 biaot,4=WinGetTitle, 获取窗口标题变量, ahk_class HH Parent biaoti,3=WinSetTitle, ahk_class HH Parent, , 修改窗口标题 biaoti,4=WinGetTitle, 获取窗口标题变量, ahk_class HH Parent bob,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") boba,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") bobao,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") bud,3=!= bude,3=!= buden,3=!= budeng,3=!= budengy,3=!= budengyu,3=!= buerz,3=False buerz,4=True buerzh,3=False buerzh,4=True buerzhi,3=False buerzhi,4=True buq,3=Format("{:02}", 6) ; 补全两位数,补成06 buq,4=Format("{:-9}", "空格补全后面") buq,5=Format("|{:-10}|`r`n|{:10}|`r`n", "左", "右") ; 等宽文本处理 buqu,3=Format("{:02}", 6) ; 补全两位数,补成06 buqu,4=Format("{:-9}", "空格补全后面") buqu,5=Format("|{:-10}|`r`n|{:10}|`r`n", "左", "右") ; 等宽文本处理 buqua,3=Format("{:02}", 6) ; 补全两位数,补成06 buqua,4=Format("{:-9}", "空格补全后面") buqua,5=Format("|{:-10}|`r`n|{:10}|`r`n", "左", "右") ; 等宽文本处理 buquan,3=Format("{:02}", 6) ; 补全两位数,补成06 buquan,4=Format("{:-9}", "空格补全后面") buquan,5=Format("|{:-10}|`r`n|{:10}|`r`n", "左", "右") ; 等宽文本处理 by,3=ByRef byr,3=ByRef byre,3=ByRef byref,3=ByRef ca,3=Case cas,1=Case case,1=Case caid,3= ; AHK为菜单栏创建子菜单: Menu, FileMenu, Add, 新建(&N), GuiClose Menu, FileMenu, Add, 打开(&O), GuiClose Menu, FileMenu, Add, 保存(&S), GuiClose Menu, FileMenu, Add, 另存为(&A), GuiClose Menu, FileMenu, Add ; 分隔线. Menu, FileMenu, Add, 退出(&E), GuiClose Menu, HelpMenu, Add, 关于(&A), GuiClose ; 创建用来附加子菜单的菜单栏: Menu, MyMenuBar, Add, &文件(&F), :FileMenu Menu, MyMenuBar, Add, &帮助(&H), :HelpMenu ; 添加菜单栏到窗口: Gui Menu, MyMenuBar GuiClose() { ExitApp } caida,3= ; AHK为菜单栏创建子菜单: Menu, FileMenu, Add, 新建(&N), GuiClose Menu, FileMenu, Add, 打开(&O), GuiClose Menu, FileMenu, Add, 保存(&S), GuiClose Menu, FileMenu, Add, 另存为(&A), GuiClose Menu, FileMenu, Add ; 分隔线. Menu, FileMenu, Add, 退出(&E), GuiClose Menu, HelpMenu, Add, 关于(&A), GuiClose ; 创建用来附加子菜单的菜单栏: Menu, MyMenuBar, Add, &文件(&F), :FileMenu Menu, MyMenuBar, Add, &帮助(&H), :HelpMenu ; 添加菜单栏到窗口: Gui Menu, MyMenuBar GuiClose() { ExitApp } caidan,3= ; AHK为菜单栏创建子菜单: Menu, FileMenu, Add, 新建(&N), GuiClose Menu, FileMenu, Add, 打开(&O), GuiClose Menu, FileMenu, Add, 保存(&S), GuiClose Menu, FileMenu, Add, 另存为(&A), GuiClose Menu, FileMenu, Add ; 分隔线. Menu, FileMenu, Add, 退出(&E), GuiClose Menu, HelpMenu, Add, 关于(&A), GuiClose ; 创建用来附加子菜单的菜单栏: Menu, MyMenuBar, Add, &文件(&F), :FileMenu Menu, MyMenuBar, Add, &帮助(&H), :HelpMenu ; 添加菜单栏到窗口: Gui Menu, MyMenuBar GuiClose() { ExitApp } caidanl,3= ; AHK为菜单栏创建子菜单: Menu, FileMenu, Add, 新建(&N), GuiClose Menu, FileMenu, Add, 打开(&O), GuiClose Menu, FileMenu, Add, 保存(&S), GuiClose Menu, FileMenu, Add, 另存为(&A), GuiClose Menu, FileMenu, Add ; 分隔线. Menu, FileMenu, Add, 退出(&E), GuiClose Menu, HelpMenu, Add, 关于(&A), GuiClose ; 创建用来附加子菜单的菜单栏: Menu, MyMenuBar, Add, &文件(&F), :FileMenu Menu, MyMenuBar, Add, &帮助(&H), :HelpMenu ; 添加菜单栏到窗口: Gui Menu, MyMenuBar GuiClose() { ExitApp } cej,3=XButton1 ceji,3=XButton1 cejia,3=XButton1 cejian,3=XButton1 ces,3= t1:=A_TickCount MsgBox % "耗时:" A_TickCount-t1 " 毫秒" ces,4= 计时() MsgBox % "耗时:" 计时() " 毫秒" Return 计时() { Static if 开始= DllCall("QueryPerformanceFrequency", "Int64*", 频率), DllCall("QueryPerformanceCounter", "Int64*", 开始) else DllCall("QueryPerformanceCounter", "Int64*", 结束), 耗时:=(结束 - 开始)/频率*1000, 开始:="" Return 耗时 } cesu,3= t1:=A_TickCount MsgBox % "耗时:" A_TickCount-t1 " 毫秒" cesu,4= 计时() MsgBox % "耗时:" 计时() " 毫秒" Return 计时() { Static if 开始= DllCall("QueryPerformanceFrequency", "Int64*", 频率), DllCall("QueryPerformanceCounter", "Int64*", 开始) else DllCall("QueryPerformanceCounter", "Int64*", 结束), 耗时:=(结束 - 开始)/频率*1000, 开始:="" Return 耗时 } ceshi,3= Loop { Sleep 10 MouseGetPos, x, y ToolTip 持续运算演示-%A_Index%, x+10, y-30 } cl,1=Class cla,1=Class clas,1=Class class,1=Class char,3=GuiControl,, Edit1, %写入编辑框的内容% charu,3=GuiControl,, Edit1, %写入编辑框的内容% chix,3= #Persistent chixu,3= #Persistent chixv,3= #Persistent chongmingm,3=FileMove, D:\原文件名.txt, D:\新文件名.txt chongmingmi,3=FileMove, D:\原文件名.txt, D:\新文件名.txt chongmingmin,3=FileMove, D:\原文件名.txt, D:\新文件名.txt chongmingming,3=FileMove, D:\原文件名.txt, D:\新文件名.txt chongq,3=Reload chongq,4=Shutdown, 6 chongqi,3=Reload chongqi,4=Shutdown, 6 chuangj,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 chuangji,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 chuangjia,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 chuangjian,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 chuangk,3=WinActivate, ahk_class 激活窗口 chuangk,4=WinWait, ahk_class 等待窗口 chuangk,5=WinMove, ahk_class 移动窗口,, 100, 200 chuangk,6=WinClose, ahk_class 关闭窗口 chuangk,7=PostMessage, 0x112, 0xF060,,, ahk_class 此为关闭窗口 chuangk,8= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive chuangk,9=WinSet, AlwaysOnTop, On, ahk_class 置顶窗口 chuangko,3=WinActivate, ahk_class 激活窗口 chuangko,4=WinWait, ahk_class 等待窗口 chuangko,5=WinMove, ahk_class 移动窗口,, 100, 200 chuangko,6=WinClose, ahk_class 关闭窗口 chuangko,7=PostMessage, 0x112, 0xF060,,, ahk_class 此为关闭窗口 chuangko,8= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive chuangko,9=WinSet, AlwaysOnTop, On, ahk_class 置顶窗口 chuangkou,3=WinActivate, ahk_class 激活窗口 chuangkou,4=WinWait, ahk_class 等待窗口 chuangkou,5=WinMove, ahk_class 移动窗口,, 100, 200 chuangkou,6=WinClose, ahk_class 关闭窗口 chuangkou,7=PostMessage, 0x112, 0xF060,,, ahk_class 此为关闭窗口 chuangkou,8= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive chuangkou,9=WinSet, AlwaysOnTop, On, ahk_class 置顶窗口 cj,3=Ctrl cj,4=^ cjian,3=Ctrl cjian,4=^ cmd,3=Run %ComSpec% /c "填写Cmd命令_隐藏黑窗参考帮助文档" daim,3=LTrim ` % daima,3=LTrim ` % danh,3=Sc956::单行标签写法 danha,3=Sc956::单行标签写法 danhan,3=Sc956::单行标签写法 danhang,3=Sc956::单行标签写法 daor,3= #Include %A_ScriptDir%\FindText.ahk daor,4= #Include <FindText> daoru,3= #Include %A_ScriptDir%\FindText.ahk daoru,4= #Include <FindText> dax,3= ; 大写转小写 Format("{:L}", "LOWER") dax,4= ; 小写转大写 Format("{:U}", "upper") daxi,3= ; 大写转小写 Format("{:L}", "LOWER") daxi,4= ; 小写转大写 Format("{:U}", "upper") daxie,3= ; 大写转小写 Format("{:L}", "LOWER") daxie,4= ; 小写转大写 Format("{:U}", "upper") daxia,3=WinGetPos, pX, pY, pW, pH, ahk_class Shell_TrayWnd daxiao,3=WinGetPos, pX, pY, pW, pH, ahk_class Shell_TrayWnd day,3=exit dayi,3=exit dayin,3=exit de,3=Debug() de,4=Debug_() de,5=OutputDebug deb,1=Debug() deb,2=Debug_() deb,3=OutputDebug debu,1=Debug() debu,2=Debug_() debu,3=OutputDebug debug,1=Debug() debug,2=Debug_() debug,3=OutputDebug dengd,3=WinWait, ahk_class 等待窗口出现 dengd,4=Process, Wait, QQ.exe dengd,5=Sleep 1000 dengd,6= ; 等待 A 键被释放 KeyWait, a dengda,3=WinWait, ahk_class 等待窗口出现 dengda,4=Process, Wait, QQ.exe dengda,5=Sleep 1000 dengda,6= ; 等待 A 键被释放 KeyWait, a dengdai,3=WinWait, ahk_class 等待窗口出现 dengdai,4=Process, Wait, QQ.exe dengdai,5=Sleep 1000 dengdai,6= ; 等待 A 键被释放 KeyWait, a dianj,3=Click, 12, 34 dianj,4=MouseClick, , 12, 34, , 0 dianj,5=MouseClickDrag, L, 150, 150, 250, 250 dianj,6=click() dianji,3=Click, 12, 34 dianji,4=MouseClick, , 12, 34, , 0 dianji,5=MouseClickDrag, L, 150, 150, 250, dianji,6=click() diann,3=Explorer.exe dianna,3=Explorer.exe diannao,3=Explorer.exe dllc,1=DllCall dllca,1=DllCall dllcal,1=DllCall dllcall,1=DllCall down,1=Down duok,3= WinGet, 遍历id, List, ahk_class Notepad Loop %遍历id% WinActivate, % "ahk_id " 遍历id%A_Index% duoka,3= WinGet, 遍历id, List, ahk_class Notepad Loop %遍历id% WinActivate, % "ahk_id " 遍历id%A_Index% duokai,3= WinGet, 遍历id, List, ahk_class Notepad Loop %遍历id% WinActivate, % "ahk_id " 遍历id%A_Index% duq,3=FileRead, 读取文件到变量, D:\My File.txt duq,4=FileReadLine, 指定行_读取文件指定行到变量, D:\ContactList.txt, 12 duq,5=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu duq,6=iniRead, 读取到变量, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 duq,7=AHKini["段名", "键名"] := "键值" duqu,3=FileRead, 读取文件到变量, D:\My File.txt duqu,4=FileReadLine, 指定行_读取文件指定行到变量, D:\ContactList.txt, 12 duqu,5=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu duqu,6=iniRead, 读取到变量, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 duqu,7=AHKini["段名", "键名"] := "键值" dpi,3=A_ScreenDPI/96 dpi,4=-DPIScale esc,1=Esc exi,1=ExitApp fal,1=False fals,1=False false,1=False fanh,3=Return fanh,4=Rtn fanh,5= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } fanhu,3=Return fanhu,4=Rtn fanhu,5= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } fanhui,3=Return fanhui,4=Rtn fanhui,5= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } fenbi,3=A_ScreenWidth宽 fenbi,4=A_ScreenHeight高 fenbia,3=A_ScreenWidth宽 fenbia,4=A_ScreenHeight高 fenbian,3=A_ScreenWidth宽 fenbian,4=A_ScreenHeight高 fenbianl,3=A_ScreenWidth宽 fenbianl,4=A_ScreenHeight高 fenbianlv,3=A_ScreenWidth宽 fenbianlv,4=A_ScreenHeight高 feng,3=StrSplit(分割取第二行, "`n") fenge,3=StrSplit(分割取第二行, "`n") fengex,3=Gui Add, Text, x10 y10 w250 h1 0x10 fengexi,3=Gui Add, Text, x10 y10 w250 h1 0x10 fengexia,3=Gui Add, Text, x10 y10 w250 h1 0x10 fengexian,3=Gui Add, Text, x10 y10 w250 h1 0x10 for,3= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v fas,3=Send fas,4=Send {text} fas,5=SendInput faso,3=Send faso,4=Send {text} faso,5=SendInput fason,3=Send fason,4=Send {text} fason,5=SendInput fasong,3=Send fasong,4=Send {text} fasong,5=SendInput fei,3=! fei,4=NOT find,1=FindText find,3=FindText().SavePic(A_Desktop "\1.bmp", 0, 0, A_ScreenWidth, A_ScreenHeight) find,4= Hwnd := WinExist("ahk_class AHKEditor") FindText().BindWindow(Hwnd, 4) find,5=, , 0 find,6=, , , , , , 9 ; 1 ==> ( 从左到右 ) 从上到下 ; 2 ==> ( 从右到左 ) 从上到下 ; 3 ==>(从左到右)从下到上 ; 4 ==>(从右到左)从下到上 ; 5 ==>(从上到下)从左到右 ; 6 ==>(从下到上)从左到右 ; 7 ==>(从上到下)从右到左 ; 8 ==>(从下到上)从右到左 ; 9 ==>从中心向外 fouz,3=else fouze,3=else f,3=█ f,4=↑ f,5=↓ fu,3=█ fuz,3=FileCopy, D:\复制文件.txt, D:\新文件.txt, 1 fuz,4=FileCopyDir, D:\复制目录, D:\新目录, 1 fuzi,3=FileCopy, D:\复制文件.txt, D:\新文件.txt, 1 fuzi,4=FileCopyDir, D:\复制目录, D:\新目录, 1 g,3=Gui Show, , 窗口 g,4=Gui Destroy g,5=Gui +HwndGuiID -MaximizeBox -MinimizeBox +AlwaysOnTop gao,3=A_ScreenHeight gao,4=Height gao,5=h20 ges,3=LTrim ` % gesh,3=LTrim ` % geshi,3=LTrim ` % gh,3=GitHub git,3=GitHub gith,3=GitHub githu,3=GitHub github,3=GitHub gos,1=Gosub goto,1=Goto gu,3=Gui Show, , 窗口 gu,4=Gui Destroy gu,5=Gui +HwndGuiID -MaximizeBox -MinimizeBox +AlwaysOnTop guan,3=off guanb,3=WinClose, ahk_class 关闭窗口 guanb,4=PostMessage, 0x112, 0xF060,,, ahk_class 此为关闭窗口 guanbi,3=WinClose, ahk_class 关闭窗口 guanbi,4=PostMessage, 0x112, 0xF060,,, ahk_class 此为关闭窗口 guanliy,3= ; AHK脚本以管理员权限自启 if !A_IsAdmin && !RegExMatch(_:=DllCall("GetCommandLine", "Str"), " /restart(?!\S)") RunWait % "*RunAs " RegExReplace(_, "^\"".*?\""\K|^\S*\K", " /restart") guanliy,4= if !A_IsAdmin && A_IsCompiled { RegWrite, REG_SZ, HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers, %A_ScriptFullPath%, ~ RUNASADMIN Try Run *RunAs "%A_ScriptFullPath%" /r ExitApp } guanliy,5= ; AHK以管理员自启【无传参】 if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "Str"), ".exe /r")) RunWait % "*RunAs " (_:=A_IsCompiled ? """" : A_AhkPath " /r """) A_ScriptFullPath (_ ? """" : """ /r") guanliyu,3= ; AHK脚本以管理员权限自启 if !A_IsAdmin && !RegExMatch(_:=DllCall("GetCommandLine", "Str"), " /restart(?!\S)") RunWait % "*RunAs " RegExReplace(_, "^\"".*?\""\K|^\S*\K", " /restart") guanliyu,4= if !A_IsAdmin && A_IsCompiled { RegWrite, REG_SZ, HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers, %A_ScriptFullPath%, ~ RUNASADMIN Try Run *RunAs "%A_ScriptFullPath%" /r ExitApp } guanliyu,5= ; AHK以管理员自启【无传参】 if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "Str"), ".exe /r")) RunWait % "*RunAs " (_:=A_IsCompiled ? """" : A_AhkPath " /r """) A_ScriptFullPath (_ ? """" : """ /r") guanliyua,3= ; AHK脚本以管理员权限自启 if !A_IsAdmin && !RegExMatch(_:=DllCall("GetCommandLine", "Str"), " /restart(?!\S)") RunWait % "*RunAs " RegExReplace(_, "^\"".*?\""\K|^\S*\K", " /restart") guanliyua,4= if !A_IsAdmin && A_IsCompiled { RegWrite, REG_SZ, HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers, %A_ScriptFullPath%, ~ RUNASADMIN Try Run *RunAs "%A_ScriptFullPath%" /r ExitApp } guanliyua,5= ; AHK以管理员自启【无传参】 if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "Str"), ".exe /r")) RunWait % "*RunAs " (_:=A_IsCompiled ? """" : A_AhkPath " /r """) A_ScriptFullPath (_ ? """" : """ /r") guanliyuan,3= ; AHK脚本以管理员权限自启 if !A_IsAdmin && !RegExMatch(_:=DllCall("GetCommandLine", "Str"), " /restart(?!\S)") RunWait % "*RunAs " RegExReplace(_, "^\"".*?\""\K|^\S*\K", " /restart") guanliyuan,4= if !A_IsAdmin && A_IsCompiled { RegWrite, REG_SZ, HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers, %A_ScriptFullPath%, ~ RUNASADMIN Try Run *RunAs "%A_ScriptFullPath%" /r ExitApp } guanliyuan,5= ; AHK以管理员自启【无传参】 if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "Str"), ".exe /r")) RunWait % "*RunAs " (_:=A_IsCompiled ? """" : A_AhkPath " /r """) A_ScriptFullPath (_ ? """" : """ /r") guanj,3=Shutdown, 5 guanji,3=Shutdown, 5 gug,3=Chrome guge,3=Chrome gui,3=Gui Show, , 窗口 gui,4=Gui Destroy gui,5=GuiControl,, Edit1, %写入编辑框的内容% gui,6=Gui +HwndGuiID -MaximizeBox -MinimizeBox +AlwaysOnTop gui,7= GuiClose: ExitApp gui,8= ; 一组参考模板 Gui Add, Text, w-2 h-2 Section ; 改成 xs 可当换行用 Gui Add, Text, Section, 测试: ; Section保存此控件位置并定义新一行的控件段 Gui Add, Edit, ys-4 ; 在此控件段中开始一个新列【-4是为了对齐上句文本】 Gui Add, Button, ys-5, 保存 gui,9=Gui Submit, NoHide ; 保存v变量为变量【通过g标签实时赋值】 gunl,3=WheelUp gunl,4=WheelDown gunlu,3=WheelUp gunlu,4=WheelDown gunlun,3=WheelUp gunlun,4=WheelDown guol,3=LTrim ` % guolu,3=LTrim ` % guolv,3=LTrim ` % hans,3=Func hans,4=Function hans,5=Func(A_ThisFunc).Bind("this") hans,6=this. hansh,3=Func hansh,4=Function hansh,5=Func(A_ThisFunc).Bind("this") hansh,6=this. hanshu,3=Func hanshu,4=Function hanshu,5=Func(A_ThisFunc).Bind("this") hanshu,6=this. han,3=if RegExMatch(有汉字判断, "m)(*ANYCRLF)[\x{4e00}-\x{9fa5}]+", 0, 1) hanz,3=if RegExMatch(有汉字判断, "m)(*ANYCRLF)[\x{4e00}-\x{9fa5}]+", 0, 1) hanzi,3=if RegExMatch(有汉字判断, "m)(*ANYCRLF)[\x{4e00}-\x{9fa5}]+", 0, 1) hb,3= #WindowClassMain ClassName hb,4= #WindowClassGui ClassName hb,5= #WarnContinuableException Off hb,6=共享对象 := CriticalObject(共享对象) hb,7=DynaRun("MsgBox 新进程代码", "NewScriptName") hb,8=UnZip("D:\压缩包.zip", "D:\释放路径\") hba,3= #WindowClassMain ClassName hba,4= #WindowClassGui ClassName hba,5= #WarnContinuableException Off hba,6=共享对象 := CriticalObject(共享对象) hba,7=DynaRun("MsgBox 新进程代码", "NewScriptName") hba,8=UnZip("D:\压缩包.zip", "D:\释放路径\") hban,3= #WindowClassMain ClassName hban,4= #WindowClassGui ClassName hban,5= #WarnContinuableException Off hban,6=共享对象 := CriticalObject(共享对象) hban,7=DynaRun("MsgBox 新进程代码", "NewScriptName") hban,8=UnZip("D:\压缩包.zip", "D:\释放路径\") he,3=Black hei,3=Black heis,3=Black heise,3=Black ho,3=Red hon,3=Red hong,3=Red hongs,3=Red hongse,3=Red hout,3=ControlSend, ahk_parent, {Space}, ahk_class 后台发送按键 hout,4=ControlClick, x123 y456, ahk_class 后台点击鼠标 hout,5=Control, Check, , Button2, ahk_class 后台稳定点击控件 hout,6= WinGetPos, _, __, , , ahk_class 模拟后台相对坐标点击 MouseClick, , _+123, __+234, , 0 hout,7= 后台安全点击(x, y, WinTitle) { SetControlDelay, % ("-1", ACD:=A_ControlDelay) BlockInput MouseMove ControlClick, x%x% y%y%, %WinTitle%, , , , NA BlockInput MouseMoveOff SetControlDelay, %ACD% } houta,3=ControlSend, ahk_parent, {Space}, ahk_class 后台发送按键 houta,4=ControlClick, x123 y456, ahk_class 后台点击鼠标 houta,5=Control, Check, , Button2, ahk_class 后台稳定点击控件 houta,6= WinGetPos, _, __, , , ahk_class 模拟后台相对坐标点击 MouseClick, , _+123, __+234, , 0 houta,7= 后台安全点击(x, y, WinTitle) { SetControlDelay, % ("-1", ACD:=A_ControlDelay) BlockInput MouseMove ControlClick, x%x% y%y%, %WinTitle%, , , , NA BlockInput MouseMoveOff SetControlDelay, %ACD% } houtai,3=ControlSend, ahk_parent, {Space}, ahk_class 后台发送按键 houtai,4=ControlClick, x123 y456, ahk_class 后台点击鼠标 houtai,5=Control, Check, , Button2, ahk_class 后台稳定点击控件 houtai,6= WinGetPos, _, __, , , ahk_class 模拟后台相对坐标点击 MouseClick, , _+123, __+234, , 0 houtai,7= 后台安全点击(x, y, WinTitle) { SetControlDelay, % ("-1", ACD:=A_ControlDelay) BlockInput MouseMove ControlClick, x%x% y%y%, %WinTitle%, , , , NA BlockInput MouseMoveOff SetControlDelay, %ACD% } houz,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 houzh,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 houzhu,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 houzhui,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 houzu,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 houzui,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 huang,3=Yellow huangs,3=Yellow huangse,3=Yellow huanh,3=xs ; 换行 huanh,4=ys-4 ; 换列 huanh,5=R1 ; 限制为一行 huanh,6=<p><br></p> huanha,3=xs ; 换行 huanha,4=ys-4 ; 换列 huanha,5=R1 ; 限制为一行 huanha,6=<p><br></p> huanhan,3=xs ; 换行 huanhan,4=ys-4 ; 换列 huanhan,5=R1 ; 限制为一行 huanhan,6=<p><br></p> huanhang,3=xs ; 换行 huanhang,4=ys-4 ; 换列 huanhang,5=R1 ; 限制为一行 huanhang,6=<p><br></p> huany,3=WinRestore, ahk_class 还原最小窗口 huany,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore huanyu,3=WinRestore, ahk_class 还原最小窗口 huanyu,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore huanyua,3=WinRestore, ahk_class 还原最小窗口 huanyua,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore huanyuan,3=WinRestore, ahk_class 还原最小窗口 huanyuan,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore huic,3=Enter huich,3=Enter huiche,3=Enter huo,3=|| huo,4=or huoq,3=MouseGetPos, x, y, id, 控件类名 huoq,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% huoq,5=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 huoq,6=WinGetPos, pX, pY, pW, pH, ahk_class Shell_TrayWnd huoq,7=ControlGetText, 控件文本变量, Static5, ahk_class AHKEditor huoq,8=WinGet, 遍历id, List, ahk_class Notepad huoq,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% huoqu,3=MouseGetPos, x, y, id, 控件类名 huoqu,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% huoqu,5=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 huoqu,6=WinGetPos, pX, pY, pW, pH, ahk_class Shell_TrayWnd huoqu,7=ControlGetText, 控件文本变量, Static5, ahk_class AHKEditor huoqu,8=WinGet, 遍历id, List, ahk_class Notepad huoqu,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% ib,3=IBStyle() ib,4=IBStyle(0) ; 批量所有 ib,5=IBStyle(0, , , "White") ib,6=Gui, Color, White id,3=Hwnd id,4=WinGet, Hwnd变量, ID, ahk_class 取窗口ID id,5=窗口ID := WinExist("A") id,6=+HwndhGui id,7=WinGet, idList, List, ahk_class CabinetWClass ; 输出idList12345 if,2=if InStr(Clipboard, "剪贴板里有我") if,3=if FileExist("文件存在") if,4=if WinExist("窗口存在") if,5=if WinActive("窗口正激活") if,6= if 变量不是 not in exe,bat MsgBox 变量不是exe或bat时触发 if,7= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 if,8=if (Mod(A_Index,10)=0) if,9= ; 一行if窗口写法 ifWinNotExist, ahk_class 窗口类名, , MsgBox 窗口不存在时,弹窗后退出脚本 ExitApp ini,3=iniRead, 读取到变量, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 ini,4=iniWrite, 写入内容, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 ini,5=iniDelete, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 ini,6=AHKini := New Easyini("Myini.ini") ini,7=AHKini["段名", "键名"] := "键值" ini,8=AHKIni.RemoveKey("段名", "键名") ini,9=AHKini.Save() ip,3=A_IPAddress1 jia,3=False jianc,3=if FileExist("文件存在") jianch,3=if FileExist("文件存在") jiancha,3=if FileExist("文件存在") jians,3=if FileExist("文件存在") jiansu,3=if FileExist("文件存在") jiansuo,3=if FileExist("文件存在") jiantie,3=Clipboard jiantie,4=ClipWait, 2 jiantie,5=ClipboardAll jiantieb,3=Clipboard jiantieb,4=ClipWait, 2 jiantieb,5=ClipboardAll jiantieba,3=Clipboard jiantieba,4=ClipWait, 2 jiantieba,5=ClipboardAll jiantieban,3=Clipboard jiantieban,4=ClipWait, 2 jiantieban,5=ClipboardAll jiaod,3=ControlFocus, Edit1 jiaod,4=Gui Add, Slider, w1 h1 ; 处理默认焦点虚线问题 jiaodi,3=ControlFocus, Edit1 jiaodi,4=Gui Add, Slider, w1 h1 ; 处理默认焦点虚线问题 jiaodia,3=ControlFocus, Edit1 jiaodia,4=Gui Add, Slider, w1 h1 ; 处理默认焦点虚线问题 jiaodian,3=ControlFocus, Edit1 jiaodian,4=Gui Add, Slider, w1 h1 ; 处理默认焦点虚线问题 jiaz,3= #Include %A_ScriptDir%\FindText.ahk jiaz,4= #Include <FindText> jiaz,5=DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr") jiaza,3= #Include %A_ScriptDir%\FindText.ahk jiaza,4= #Include <FindText> jiaza,5=DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr") jiazai,3= #Include %A_ScriptDir%\FindText.ahk jiazai,4= #Include <FindText> jiazai,5=DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr") jieg,3=VarSetCapacity(Var, 1024) jieg,4=NumPut(47, Var, 0, "int") ; 首次Var:=0赋值可以免去VarSetCapacity分配空间 jieg,5=Num:=NumGet(Var, 0, "int") jieg,6=Str := StrGet(地址, 1024, "UTF-8") jiego,3=VarSetCapacity(Var, 1024) jiego,4=NumPut(47, Var, 0, "int") ; 首次Var:=0赋值可以免去VarSetCapacity分配空间 jiego,5=Num:=NumGet(Var, 0, "int") jiego,6=Str := StrGet(地址, 1024, "UTF-8") jiegou,3=VarSetCapacity(Var, 1024) jiegou,4=NumPut(47, Var, 0, "int") ; 首次Var:=0赋值可以免去VarSetCapacity分配空间 jiegou,5=Num:=NumGet(Var, 0, "int") jiegou,6=Str := StrGet(地址, 1024, "UTF-8") jiem,3=Gui Destroy jiem,4=Gui Submit ; 保存并隐藏 jiem,5=+HwndGuiID jiemi,3=Gui Destroy jiemi,4=Gui Submit ; 保存并隐藏 jiemi,5=+HwndGuiID jiemia,3=Gui Destroy jiemia,4=Gui Submit ; 保存并隐藏 jiemia,5=+HwndGuiID jiemian,3=Gui Destroy jiemian,4=Gui Submit ; 保存并隐藏 jiemian,5=+HwndGuiID jieq,3=SubStr(A_AhkPath, 1, StrLen(A_AhkPath)-3) jiequ,3=SubStr(A_AhkPath, 1, StrLen(A_AhkPath)-3) jies,3=Return jiesh,3=Return jieshu,3=Return jiesu,3=Return jih,3=WinActivate, ahk_class 激活窗口 jih,4=WinWaitActive, ahk_class 等待激活窗口 jihu,3=WinActivate, ahk_class 激活窗口 jihu,4=WinWaitActive, ahk_class 等待激活窗口 jihuo,3=WinActivate, ahk_class 激活窗口 jihuo,4=WinWaitActive, ahk_class 等待激活窗口 jihua,3=taskschd.msc jihuar,3=taskschd.msc jihuare,3=taskschd.msc jihuaren,3=taskschd.msc jihuarenw,3=taskschd.msc jihuarenwu,3=taskschd.msc jinc,3=Process, Close, QQ.exe jinc,4= Process, Exist, QQ.exe if ErrorLevel MsgBox QQ进程存在 else MsgBox QQ进程不存在 jinc,5=WinGet, PID, PID, ahk_class AHKEditor jinc,6= 与进程同步退出(PID) { IfEqual, PID, 0, ExitApp DllCall("RegisterWaitForSingleObject", "Ptr*", 0, "Ptr", DllCall("OpenProcess", "Uint", 0x100000, "int", 0, "Uint", PID, "Ptr"), "Ptr", RegisterCallback("与进程同步退出", "F"), "Ptr", 0, "Uint", -1, "Uint", 8) } jinc,7=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) jinch,3=Process, Close, QQ.exe jinch,4= Process, Exist, QQ.exe if ErrorLevel MsgBox QQ进程存在 else MsgBox QQ进程不存在 jinch,5=WinGet, PID, PID, ahk_class AHKEditor jinch,6= 与进程同步退出(PID) { IfEqual, PID, 0, ExitApp DllCall("RegisterWaitForSingleObject", "Ptr*", 0, "Ptr", DllCall("OpenProcess", "Uint", 0x100000, "int", 0, "Uint", PID, "Ptr"), "Ptr", RegisterCallback("与进程同步退出", "F"), "Ptr", 0, "Uint", -1, "Uint", 8) } jinch,7=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) jinche,3=Process, Close, QQ.exe jinche,4= Process, Exist, QQ.exe if ErrorLevel MsgBox QQ进程存在 else MsgBox QQ进程不存在 jinche,5=WinGet, PID, PID, ahk_class AHKEditor jinche,6= 与进程同步退出(PID) { IfEqual, PID, 0, ExitApp DllCall("RegisterWaitForSingleObject", "Ptr*", 0, "Ptr", DllCall("OpenProcess", "Uint", 0x100000, "int", 0, "Uint", PID, "Ptr"), "Ptr", RegisterCallback("与进程同步退出", "F"), "Ptr", 0, "Uint", -1, "Uint", 8) } jinche,7=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) jinchen,3=Process, Close, QQ.exe jinchen,4= Process, Exist, QQ.exe if ErrorLevel MsgBox QQ进程存在 else MsgBox QQ进程不存在 jinchen,5=WinGet, PID, PID, ahk_class AHKEditor jinchen,6= 与进程同步退出(PID) { IfEqual, PID, 0, ExitApp DllCall("RegisterWaitForSingleObject", "Ptr*", 0, "Ptr", DllCall("OpenProcess", "Uint", 0x100000, "int", 0, "Uint", PID, "Ptr"), "Ptr", RegisterCallback("与进程同步退出", "F"), "Ptr", 0, "Uint", -1, "Uint", 8) } jinchen,7=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) jincheng,3=Process, Close, QQ.exe jincheng,4= Process, Exist, QQ.exe if ErrorLevel MsgBox QQ进程存在 else MsgBox QQ进程不存在 jincheng,5=WinGet, PID, PID, ahk_class AHKEditor jincheng,6= 与进程同步退出(PID) { IfEqual, PID, 0, ExitApp DllCall("RegisterWaitForSingleObject", "Ptr*", 0, "Ptr", DllCall("OpenProcess", "Uint", 0x100000, "int", 0, "Uint", PID, "Ptr"), "Ptr", RegisterCallback("与进程同步退出", "F"), "Ptr", 0, "Uint", -1, "Uint", 8) } jincheng,7=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) jiny,3=Disabled jinyo,3=Disabled jinyon,3=Disabled jinyong,3=Disabled jinz,3=Format("0x{:X}", 16777215) jinz,4=BlockInput On ; 阻止键鼠 jinz,5=BlockInput, MouseMove ; 阻止鼠标 jinz,6=BlockInput, MouseMoveOff ; 允许鼠标 jinzh,3=Format("0x{:X}", 16777215) jinzh,4=BlockInput On ; 阻止键鼠 jinzh,5=BlockInput, MouseMove ; 阻止鼠标 jinzh,6=BlockInput, MouseMoveOff ; 允许鼠标 jinzhi,3=Format("0x{:X}", 16777215) jinzhi,4=BlockInput On ; 阻止键鼠 jinzhi,5=BlockInput, MouseMove ; 阻止鼠标 jinzhi,6=BlockInput, MouseMoveOff ; 允许鼠标 jis,3=SetTimer 标签名, -1000 jish,3=SetTimer 标签名, -1000 jishi,3=SetTimer 标签名, -1000 jishi,4= t1:=A_TickCount MsgBox % "耗时:" A_TickCount-t1 " 毫秒" jishi,5= 计时() MsgBox % "耗时:" 计时() " 毫秒" Return 计时() { Static if 开始= DllCall("QueryPerformanceFrequency", "Int64*", 频率), DllCall("QueryPerformanceCounter", "Int64*", 开始) else DllCall("QueryPerformanceCounter", "Int64*", 结束), 耗时:=(结束 - 开始)/频率*1000, 开始:="" Return 耗时 } jishi,6= SetTimer 秒分表, 55000 秒分表: if (A_Hour=20) && (A_Min=59) MsgBox 8点59分执行 Return jishib,3=ahk_class Notepad jishib,4=Notepad jishibe,3=ahk_class Notepad jishibe,4=Notepad jishiben,3=ahk_class Notepad jishiben,4=Notepad jishiq,3=SetTimer 标签名, -1000 jishiq,4= if p is Number { ; 函数参数加上p:=50,可实现异步启动函数。!s例:Asynchronous(p:=50) SetTimer %s%, % "-" p s:=Func(A_ThisFunc).Bind("Asynchronous") Return } jishiqi,3=SetTimer 标签名, -1000 jishiqi,4= if p is Number { ; 函数参数加上p:=50,可实现异步启动函数。!s例:Asynchronous(p:=50) SetTimer %s%, % "-" p s:=Func(A_ThisFunc).Bind("Asynchronous") Return } jisu,3=n := n ? ++n : 1 jish,4=if (A_Index&1) jishu,3=n := n ? ++n : 1 jishu,4=if (A_Index&1) jisi,3=SetTimer 标签名, -1000 jisiq,3=SetTimer 标签名, -1000 jisiqi,3=SetTimer 标签名, -1000 jix,3=Continue jixv,3=Continue jixu,3=Continue js,3=JSON_Load(字符串) ; 转成对象 js,4=JSON_Dump(对象) ; 转成字符串 jso,3=JSON_Load(字符串) ; 转成对象 jso,4=JSON_Dump(对象) ; 转成字符串 json,3=JSON_Load(字符串) ; 转成对象 json,4=JSON_Dump(对象) ; 转成字符串 jub,3=Hwnd jub,4=local jubu,4=local jubi,3=Hwnd jubin,3=Hwnd jubing,3=Hwnd juz,3=Center juzh,3=Center juzho,3=Center juzhon,3=Center juzhong,3=Center kai,3=on kaig,3=onoff kaig,4=toggle kaigu,3=onoff kaigu,4=toggle kaigua,3=onoff kaigua,4=toggle kaiguan,3=onoff kaiguan,4=toggle kej,3=ControlGet, 可见判断, Visible, , Edit1, ahk_class Notepad keji,3=ControlGet, 可见判断, Visible, , Edit1, ahk_class Notepad kejia,3=ControlGet, 可见判断, Visible, , Edit1, ahk_class Notepad kejian,3=ControlGet, 可见判断, Visible, , Edit1, ahk_class Notepad kongg,3=Space kongg,4= kongge,3=Space kongge,4= kongj,3=Gui Add, Button, w80, 按钮名 kongj,4=Gui Add, Text,, 文本内容 kongj,5=Gui Add, Edit, r9 vMyEdit w135, 可设置初始文本 kongj,6=Gui Add, Hotkey, v变量 kongj,7=Gui Add, Radio, Checked1, 文本内容 ; 单选按钮 kongj,8=Gui Add, CheckBox, Checked1 h16, 文本内容 ; 多选按钮 kongj,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% kongji,3=Gui Add, Button, w80, 按钮名 kongji,4=Gui Add, Text,, 文本内容 kongji,5=Gui Add, Edit, r9 vMyEdit w135, 可设置初始文本 kongji,6=Gui Add, Hotkey, v变量 kongji,7=Gui Add, Radio, Checked1, 文本内容 ; 单选按钮 kongji,8=Gui Add, CheckBox, Checked1 h16, 文本内容 ; 多选按钮 kongji,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% kongjia,3=Gui Add, Button, w80, 按钮名 kongjia,4=Gui Add, Text,, 文本内容 kongjia,5=Gui Add, Edit, r9 vMyEdit w135, 可设置初始文本 kongjia,6=Gui Add, Hotkey, v变量 kongjia,7=Gui Add, Radio, Checked1, 文本内容 ; 单选按钮 kongjia,8=Gui Add, CheckBox, Checked1 h16, 文本内容 ; 多选按钮 kongjia,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% kongjian,3=Gui Add, Button, w80, 按钮名 kongjian,4=Gui Add, Text,, 文本内容 kongjian,5=Gui Add, Edit, r9 vMyEdit w135, 可设置初始文本 kongjian,6=Gui Add, Hotkey, v变量 kongjian,7=Gui Add, Radio, Checked1, 文本内容 ; 单选按钮 kongjian,8=Gui Add, CheckBox, Checked1 h16, 文本内容 ; 多选按钮 kongjian,9=GuicontrolGet, 获取按钮状态, , %A_Guicontrol% kuaij,3=FileCreateShortcut, "%A_ScriptFullPath%", %A_DesktopCommon%\直接打开脚本.lnk kuaij,4=FileGetShortcut, %传统变量%, 完整路径名, 纯路径 kuaiji,3=FileCreateShortcut, "%A_ScriptFullPath%", %A_DesktopCommon%\直接打开脚本.lnk kuaiji,4=FileGetShortcut, %传统变量%, 完整路径名, 纯路径 kuaijie,3=FileCreateShortcut, "%A_ScriptFullPath%", %A_DesktopCommon%\直接打开脚本.lnk kuaijie,4=FileGetShortcut, %传统变量%, 完整路径名, 纯路径 kuaijief,3=FileCreateShortcut, "%A_ScriptFullPath%", %A_DesktopCommon%\直接打开脚本.lnk kuaijief,4=FileGetShortcut, %传统变量%, 完整路径名, 纯路径 kuan,3=A_ScreenWidth kuan,4=Width kuan,5=w160 lan,3=Blue lans,3=Blue lanse,3=Blue left,1=Left lei,3=Class lei,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% lei,5= #WindowClassMain NewClassName #WindowClassGui FrameWindowWrapper leim,3=Class leim,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% leim,5= #WindowClassMain NewClassName #WindowClassGui FrameWindowWrapper leimi,3=Class leimi,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% leimi,5= #WindowClassMain NewClassName #WindowClassGui FrameWindowWrapper leimin,3=Class leimin,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% leimin,5= #WindowClassMain NewClassName #WindowClassGui FrameWindowWrapper leiming,3=Class leiming,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% leiming,5= #WindowClassMain NewClassName #WindowClassGui FrameWindowWrapper leix,3= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } leix,4=字符串 := Format("{:s}", 数字) leixi,3= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } leixi,4=字符串 := Format("{:s}", 数字) leixin,3= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } leixin,4=字符串 := Format("{:s}", 数字) leixing,3= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } leixing,4=字符串 := Format("{:s}", 数字) li,3=Linux lin,3=Linux linu,3=Linux linux,3=Linux lins,3=A_Temp linsh,3=A_Temp linshi,3=A_Temp loop,1=Loop loop,2= Loop, Parse, 字符串变量解析, `n, `r { if InStr(A_LoopField, "搜索内容") MsgBox % "第" A_Index "行存在指定字符串 即搜索内容" } loop,3= Loop, read, D:\文本解析.txt 最后一行内容 := A_LoopReadLine loop,4= ; While 循环直到表达式为假 ~LButton:: While GetKeyState("LButton", "P") { Send a } Return loop,5=Break loop,6=Continue loop,7=Until loop,8= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v loop,9=IfNotEqual,6,% 一行跳 := 1, Break luj,3=%A_ScriptDir% luj,4=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 luji,3=%A_ScriptDir% luji,4=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 lujin,3=%A_ScriptDir% lujin,4=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 lujing,3=%A_ScriptDir% lujing,4=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 lv,3=Green lvs,3=Green lvse,3=Green meij,3= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v meiju,3= For k, v in [ "F1", "F3" ] MsgBox % "次数:" k "`n内容:" v msg,1=MsgBox msg,2=ToolTip msg,3= MsgBox, 4, , 是否继续执行?, 5 ; 5 秒的超时时间. IfMsgBox, No Return ; 用户点击了 "No" 按钮【用户中止】 IfMsgBox, Timeout Return ; 即超时时假定点击了 "No"【超时中止】 msg,4= InputBox, 输入值变量, 电话号码, 请输入一个电话号码。 if ErrorLevel MsgBox 按了CANCEL键 else MsgBox 您输入了 "%输入值变量%" msgb,1=MsgBox msgb,2=ToolTip msgb,3= MsgBox, 4, , 是否继续执行?, 5 ; 5 秒的超时时间. IfMsgBox, No Return ; 用户点击了 "No" 按钮【用户中止】 IfMsgBox, Timeout Return ; 即超时时假定点击了 "No"【超时中止】 msgb,4= InputBox, 输入值变量, 电话号码, 请输入一个电话号码。 if ErrorLevel MsgBox 按了CANCEL键 else MsgBox 您输入了 "%输入值变量%" msgbo,1=MsgBox msgbo,2=ToolTip msgbo,3= MsgBox, 4, , 是否继续执行?, 5 ; 5 秒的超时时间. IfMsgBox, No Return ; 用户点击了 "No" 按钮【用户中止】 IfMsgBox, Timeout Return ; 即超时时假定点击了 "No"【超时中止】 msgbo,4= InputBox, 输入值变量, 电话号码, 请输入一个电话号码。 if ErrorLevel MsgBox 按了CANCEL键 else MsgBox 您输入了 "%输入值变量%" msgbox,1=MsgBox msgbox,2=ToolTip msgbox,3= MsgBox, 4, , 是否继续执行?, 5 ; 5 秒的超时时间. IfMsgBox, No Return ; 用户点击了 "No" 按钮【用户中止】 IfMsgBox, Timeout Return ; 即超时时假定点击了 "No"【超时中止】 msgbox,4= InputBox, 输入值变量, 电话号码, 请输入一个电话号码。 if ErrorLevel MsgBox 按了CANCEL键 else MsgBox 您输入了 "%输入值变量%" mul,3=SetWorkingDir %A_ScriptDir% mul,4=A_Temp mul,5=A_DesktopCommon mul,6=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 mulu,3=SetWorkingDir %A_ScriptDir% mulu,4=A_Temp mulu,5=A_DesktopCommon mulu,6=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 neir,3=LTrim ` % neir,4=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor neiro,3=LTrim ` % neiro,4=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor neiron,3=LTrim ` % neiron,4=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor neirong,3=LTrim ` % neirong,4=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor no,3=Nodejs nod,3=Nodejs node,3=Nodejs nodej,3=Nodejs nodejs,3=Nodejs on,3=onoff on,4=toggle open,1=OpenCV openc,1=OpenCV opencv,1=OpenCV ous,3=if !(A_Index&1) oush,3=if !(A_Index&1) oushu,3=if !(A_Index&1) paix,3= Loop % 10 数字随排 .= A_Index " " Sort, 数字随排, D N Random For _, Index in 数字随排:=StrSplit(RTrim(数字随排)," ") MsgBox % "随机排序读取:" Index paixu,3= Loop % 10 数字随排 .= A_Index " " Sort, 数字随排, D N Random For _, Index in 数字随排:=StrSplit(RTrim(数字随排)," ") MsgBox % "随机排序读取:" Index paixv,3= Loop % 10 数字随排 .= A_Index " " Sort, 数字随排, D N Random For _, Index in 数字随排:=StrSplit(RTrim(数字随排)," ") MsgBox % "随机排序读取:" Index pand,3=if InStr(Clipboard, "剪贴板里有我") pand,4=if FileExist("文件存在") pand,5=if WinExist("窗口存在") pand,6=if WinActive("窗口正激活") pand,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 pand,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 pand,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } pandu,3=if InStr(Clipboard, "剪贴板里有我") pandu,4=if FileExist("文件存在") pandu,5=if WinExist("窗口存在") pandu,6=if WinActive("窗口正激活") pandu,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 pandu,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 pandu,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } pandua,3=if InStr(Clipboard, "剪贴板里有我") pandua,4=if FileExist("文件存在") pandua,5=if WinExist("窗口存在") pandua,6=if WinActive("窗口正激活") pandua,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 pandua,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 pandua,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } panduan,3=if InStr(Clipboard, "剪贴板里有我") panduan,4=if FileExist("文件存在") panduan,5=if WinExist("窗口存在") panduan,6=if WinActive("窗口正激活") panduan,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 panduan,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 panduan,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } peiz,3=Config peizh,3=Config peizhi,3=Config pid,1=PID pid,3=PID := DllCall("GetCurrentProcessId") pid,4=WinGet, PID, PID, ahk_class AHKEditor pid,5=, , , PID pingm,3=CoordMode Mouse pingm,4=CoordMode ToolTip pingm,5=CoordMode Pixel pingmu,3=CoordMode Mouse pingmu,4=CoordMode ToolTip pingmu,5=CoordMode Pixel pinj,3=LTrim ` % pinji,3=LTrim ` % pinjie,3=LTrim ` % post,1=Post post,3=PostMessage py,3=Python pyt,3=Python pyth,3=Python pytho,3=Python python,3=Python qid,3=Run qido,3=Run qidon,3=Run qidong,3=Run qingq,3= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } qingqi,3= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } qingqiu,3= 请求返回(URL, Request1="") { Local Try { Httpwhr := ComObjCreate("WinHttp.WinHttpRequest.5.1") if Request1= Httpwhr.Open("GET", URL, true), Httpwhr.Send() else Httpwhr.Open("POST", URL), Httpwhr.Send(Request1) Httpwhr.WaitForResponse() return Httpwhr.ResponseText } } qu,3=MouseGetPos, x, y, id, 控件类名 qu,4=WinGetClass, 获取类名, ahk_id %取鼠标下的id% quanji,3= quanjia,3= quanjiao,3= quanj,3=Global quanj,4= quanju,3=Global quans,3=SetBatchLines -1 quans,4= #NoEnv #KeyHistory 0 #SingleInstance Force SetBatchLines -1 ListLines Off SetWorkingDir %A_ScriptDir% quans,5=DllCall("ntdll\ZwSetTimerResolution", "UInt", 1, "UInt", 1, "UInt*", _) quansu,3=SetBatchLines -1 quansu,4= #NoEnv #KeyHistory 0 #SingleInstance Force SetBatchLines -1 ListLines Off SetWorkingDir %A_ScriptDir% quansu,5=DllCall("ntdll\ZwSetTimerResolution", "UInt", 1, "UInt", 1, "UInt*", _) qus,3= ; AHK单点取色比较 CoordMode Pixel ; 设置取色坐标系为全屏取色 if (GetColor(123,456)="0xFFFFFF") MsgBox 颜色匹配时触发 GetColor(x,y) { PixelGetColor, color, x, y, Fast RGB ; ToolTip % "该坐标点的颜色值为:" color Return color } qus,4= ; AHK屏幕找色 CoordMode Pixel ; 设置找色坐标系为全屏找色 PixelSearch, Px, Py, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xFFFFFF, 0, Fast RGB if ErrorLevel MsgBox 未在指定区域中找到该颜色 else MsgBox 该颜色的坐标为 X%Px% Y%Py% quse,3= ; AHK单点取色比较 CoordMode Pixel ; 设置取色坐标系为全屏取色 if (GetColor(123,456)="0xFFFFFF") MsgBox 颜色匹配时触发 GetColor(x,y) { PixelGetColor, color, x, y, Fast RGB ; ToolTip % "该坐标点的颜色值为:" color Return color } quse,4= ; AHK屏幕找色 CoordMode Pixel ; 设置找色坐标系为全屏找色 PixelSearch, Px, Py, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xFFFFFF, 0, Fast RGB if ErrorLevel MsgBox 未在指定区域中找到该颜色 else MsgBox 该颜色的坐标为 X%Px% Y%Py% quz,3=Floor(3.14) quz,4=Format("{:d}", 124.21) quz,5=Round(3.14) quzh,3=Floor(3.14) quzh,4=Format("{:d}", 124.21) quzh,5=Round(3.14) quzhe,3=Floor(3.14) quzhe,4=Format("{:d}", 124.21) quzhe,5=Round(3.14) quzhen,3=Floor(3.14) quzhen,4=Format("{:d}", 124.21) quzhen,5=Round(3.14) quzheng,3=Floor(3.14) quzheng,4=Format("{:d}", 124.21) quzheng,5=Round(3.14) rej,3=Hotkey, F1, 转向标签 rej,4=Hotkey, F1, Off ; 禁用热键 rej,5= ; 双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return rej,6= ; 一键开关切换 F1:: if (onoff := !onoff) { MsgBox 布尔值为%onoff%`n第一次开 } else { MsgBox 布尔值为%onoff%`n第二次关 } Return rej,7= ; 等待 A 键被释放 KeyWait, a rej,8= ; 热键指定窗口生效 #ifWinActive ahk_class 窗口类名 F1::MsgBox 填写对应指定窗口的标题名 #ifWinActive rej,9=GetKeyState("Ctrl") ; 按下时 reji,3=Hotkey, F1, 转向标签 reji,4=Hotkey, F1, Off ; 禁用热键 reji,5= ; 双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return reji,6= ; 一键开关切换 F1:: if (onoff := !onoff) { MsgBox 布尔值为%onoff%`n第一次开 } else { MsgBox 布尔值为%onoff%`n第二次关 } Return reji,7= ; 等待 A 键被释放 KeyWait, a reji,8= ; 热键指定窗口生效 #ifWinActive ahk_class 窗口类名 F1::MsgBox 填写对应指定窗口的标题名 #ifWinActive reji,9=GetKeyState("Ctrl") ; 按下时 rejia,3=Hotkey, F1, 转向标签 rejia,4=Hotkey, F1, Off ; 禁用热键 rejia,5= ; 双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return rejia,6= ; 一键开关切换 F1:: if (onoff := !onoff) { MsgBox 布尔值为%onoff%`n第一次开 } else { MsgBox 布尔值为%onoff%`n第二次关 } Return rejia,7= ; 等待 A 键被释放 KeyWait, a rejia,8= ; 热键指定窗口生效 #ifWinActive ahk_class 窗口类名 F1::MsgBox 填写对应指定窗口的标题名 #ifWinActive rejia,9=GetKeyState("Ctrl") ; 按下时 rejian,3=Hotkey, F1, 转向标签 rejian,4=Hotkey, F1, Off ; 禁用热键 rejian,5= ; 双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return rejian,6= ; 一键开关切换 F1:: if (onoff := !onoff) { MsgBox 布尔值为%onoff%`n第一次开 } else { MsgBox 布尔值为%onoff%`n第二次关 } Return rejian,7= ; 等待 A 键被释放 KeyWait, a rejian,8= ; 热键指定窗口生效 #ifWinActive ahk_class 窗口类名 F1::MsgBox 填写对应指定窗口的标题名 #ifWinActive rejian,9=GetKeyState("Ctrl") ; 按下时 rezic,3=:*:btw::你输入了 rezich,3=:*:btw::MsgBox 你输入了 "btw" rezichu,3=:*:btw::MsgBox 你输入了 "btw" rezichua,3=:*:btw::MsgBox 你输入了 "btw" rezichuan,3=:*:btw::MsgBox 你输入了 "btw" right,1=Right riq,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD riq,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec riq,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec riq,6= var := A_Now var += 31, days ; Minutes、Hours MsgBox % var riqi,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD riqi,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec riqi,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec riqi,6= var := A_Now var += 31, days ; Minutes、Hours MsgBox % var rug,3=if InStr(Clipboard, "剪贴板里有我") rug,4=if FileExist("文件存在") rug,5=if WinExist("窗口存在") rug,6=if WinActive("窗口正激活") rug,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 rug,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 rug,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } rugu,3=if InStr(Clipboard, "剪贴板里有我") rugu,4=if FileExist("文件存在") rugu,5=if WinExist("窗口存在") rugu,6=if WinActive("窗口正激活") rugu,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 rugu,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 rugu,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } ruguo,3=if InStr(Clipboard, "剪贴板里有我") ruguo,4=if FileExist("文件存在") ruguo,5=if WinExist("窗口存在") ruguo,6=if WinActive("窗口正激活") ruguo,7= if 变量包含 contains 1,3 MsgBox 变量包含1或3时触发 ruguo,8= if 变量不包含 not contains 1,3 MsgBox 变量不包含1或3时触发 ruguo,9= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } run,1=Run run,2=RunWait run,3=*RunAs up,1=Up sany,3=三元 := 三元="" ? "自身为空时赋值" : 三元 sany,4=n := n ? ++n : 1 sany,5=(a="" && a:=1) sany,6=SetBatchLines % ("-1", Bch:=A_BatchLines) sany,7=DetectHiddenWindows % ("On", DHW:=A_DetectHiddenWindows) sany,8=(a!="" || a:=1) sanyu,3=三元 := 三元="" ? "自身为空时赋值" : 三元 sanyu,4=n := n ? ++n : 1 sanyu,5=(a="" && a:=1) sanyu,6=SetBatchLines % ("-1", Bch:=A_BatchLines) sanyu,7=DetectHiddenWindows % ("On", DHW:=A_DetectHiddenWindows) sanyu,8=(a!="" || a:=1) sanyua,3=三元 := 三元="" ? "自身为空时赋值" : 三元 sanyua,4=n := n ? ++n : 1 sanyua,5=(a="" && a:=1) sanyua,6=SetBatchLines % ("-1", Bch:=A_BatchLines) sanyua,7=DetectHiddenWindows % ("On", DHW:=A_DetectHiddenWindows) sanyua,8=(a!="" || a:=1) sanyuan,3=三元 := 三元="" ? "自身为空时赋值" : 三元 sanyuan,4=n := n ? ++n : 1 sanyuan,5=(a="" && a:=1) sanyuan,6=SetBatchLines % ("-1", Bch:=A_BatchLines) sanyuan,7=DetectHiddenWindows % ("On", DHW:=A_DetectHiddenWindows) sanyuan,8=(a!="" || a:=1) sen,1=Send sen,2=Send {text} sen,3=SendInput send,1=Send send,2=Send {text} send,3=SendInput shanc,3=FileDelete, %A_ScriptDir%\删除文件.txt shanc,4=FileRemoveDir, %A_ScriptDir%\是删除文件夹, 1 shanc,5=RegDelete, HKCU\Software\dbgba, JianMing shanc,6=iniDelete, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 shanc,7=Delete shanch,3=FileDelete, %A_ScriptDir%\删除文件.txt shanch,4=FileRemoveDir, %A_ScriptDir%\是删除文件夹, 1 shanch,5=RegDelete, HKCU\Software\dbgba, JianMing shanch,6=iniDelete, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 shanch,7=Delete shanchu,3=FileDelete, %A_ScriptDir%\删除文件.txt shanchu,4=FileRemoveDir, %A_ScriptDir%\是删除文件夹, 1 shanchu,5=RegDelete, HKCU\Software\dbgba, JianMing shanchu,6=iniDelete, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 shanchu,7=Delete shang,3=Up shangx,3= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive shangxia,3= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive shangxiaw,3= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive shangxiawe,3= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive shangxiawen,3= #IfWinActive, ahk_class 热键指定窗口生效 F1::Return #IfWinActive shany,3=三元 := 三元="" ? "自身为空时赋值" : 三元 shanyu,3=三元 := 三元="" ? "自身为空时赋值" : 三元 shanyua,3=三元 := 三元="" ? "自身为空时赋值" : 三元 shanyuan,3=三元 := 三元="" ? "自身为空时赋值" : 三元 shez,3=Config shezh,3=Config shezhi,3=Config shengc,3=StrReplace(Format("{:30}", ""), " ", "a") shengch,3=StrReplace(Format("{:30}", ""), " ", "a") shengche,3=StrReplace(Format("{:30}", ""), " ", "a") shengchen,3=StrReplace(Format("{:30}", ""), " ", "a") shengcheng,3=StrReplace(Format("{:30}", ""), " ", "a") shengy,3=SoundPlay *-1 shengy,4=SoundBeep shengy,5= ; 循环报警 Loop 3 { SoundPlay *-1 Sleep 400 SoundBeep Sleep 400 } shengyi,3=SoundPlay *-1 shengyi,4=SoundBeep shengyi,5= ; 循环报警 Loop 3 { SoundPlay *-1 Sleep 400 SoundBeep Sleep 400 } shengyin,3=SoundPlay *-1 shengyin,4=SoundBeep shengyin,5= ; 循环报警 Loop 3 { SoundPlay *-1 Sleep 400 SoundBeep Sleep 400 } shij,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD shij,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec shij,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec shij,6=FormatTime, 返回星期几, %A_YYYY%%A_MM%%A_DD%, dddd shij,7= var := A_Now var += 31, Hours ; Minutes、days MsgBox % var shiji,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD shiji,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec shiji,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec shiji,6=FormatTime, 返回星期几, %A_YYYY%%A_MM%%A_DD%, dddd shiji,7= var := A_Now var += 31, Hours ; Minutes、days MsgBox % var shijia,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD shijia,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec shijia,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec shijia,6=FormatTime, 返回星期几, %A_YYYY%%A_MM%%A_DD%, dddd shijia,7= var := A_Now var += 31, Hours ; Minutes、days MsgBox % var shijian,3= ; AHK日期戳 A_YYYY "-" A_MM "-" A_DD shijian,4= ; AHK时间戳 - A_Hour "-" A_Min "-" A_Sec shijian,5= ; AHK时间戳 : A_Hour ":" A_Min ":" A_Sec shijian,6=FormatTime, 返回星期几, %A_YYYY%%A_MM%%A_DD%, dddd shijian,7= var := A_Now var += 31, Hours ; Minutes、days MsgBox % var shuangj,3= ; AHK双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return shouh,3= Try { 函数() } Catch e { ; 处理由上面区块产生的首个错误/异常 MsgBox, 抛出了一个异常!`n具体来说就是:%e% ; throw "自定义错误信息" } shouhu,3= Try { 函数() } Catch e { ; 处理由上面区块产生的首个错误/异常. MsgBox, 抛出了一个异常!`n具体来说就是:%e% ; throw "自定义错误信息" } shuangji,3= ; AHK双击才触发 $RButton:: t:=-oldt+(oldt:=A_TickCount) if (t<100 || t>400) { Send {RButton} Return } else oldt:=0 MsgBox 双击才运行你的代码 Return shuangji,4= LV列表鼠标回调(CtrlHwnd, GuiEvent) { Global LVHwnd if (A_GuiEvent="RightClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 右击 else if (A_GuiEvent="DoubleClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 双击 } shub,3=Click, 12, 34 shub,4=MouseClickDrag, L, 150, 150, 250, 250 shub,5=MouseGetPos, x, y, id, 控件类名 shub,6=MouseMove, 12, 34, 0 shub,7=MouseClick, , 12, 34, , 0 shub,8= ; 瞬点并还原鼠标 MouseGetPos, SaveX, SaveY MouseClick, , X, Y, , 0 MouseMove, SaveX, SaveY, 0 shubi,3=Click, 12, 34 shubi,4=MouseClickDrag, L, 150, 150, 250, 250 shubi,5=MouseGetPos, x, y, id, 控件类名 shubi,6=MouseMove, 12, 34, 0 shubi,7=MouseClick, , 12, 34, , 0 shubi,8= ; 瞬点并还原鼠标 MouseGetPos, SaveX, SaveY MouseClick, , X, Y, , 0 MouseMove, SaveX, SaveY, 0 shubia,3=Click, 12, 34 shubia,4=MouseClickDrag, L, 150, 150, 250, 250 shubia,5=MouseGetPos, x, y, id, 控件类名 shubia,6=MouseMove, 12, 34, 0 shubia,7=MouseClick, , 12, 34, , 0 shubia,8= ; 瞬点并还原鼠标 MouseGetPos, SaveX, SaveY MouseClick, , X, Y, , 0 MouseMove, SaveX, SaveY, 0 shubiao,3=Click, 12, 34 shubiao,4=MouseClickDrag, L, 150, 150, 250, 250 shubiao,5=MouseGetPos, x, y, id, 控件类名 shubiao,6=MouseMove, 12, 34, 0 shubiao,7=MouseClick, , 12, 34, , 0 shubiao,8= ; 瞬点并还原鼠标 MouseGetPos, SaveX, SaveY MouseClick, , X, Y, , 0 MouseMove, SaveX, SaveY, 0 shubiao,9=BlockInput On ; 阻止键鼠 shux,3=FileSetAttrib, -R+A, %A_ScriptFullPath% shuxi,3=FileSetAttrib, -R+A, %A_ScriptFullPath% shuxin,3=FileSetAttrib, -R+A, %A_ScriptFullPath% shuxing,3=FileSetAttrib, -R+A, %A_ScriptFullPath% shuzi,3= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } shuzi,4=if (数字变量+0>-1) shuzij,3=Numpad1 shuziji,3=Numpad1 shuzijia,3=Numpad1 shuzijian,3=Numpad1 shuz,3=.Length() shuz,4=.Count() shuz,5=.RemoveAt() shuz,6=.Push() shuz,7=ObjClone(浅拷贝) shuz,8= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } shuzu,3=.Length() shuzu,4=.Count() shuzu,5=.RemoveAt() shuzu,6=.Push() shuzu,7=ObjClone(浅拷贝) shuzu,8= 类型判断(v) { if IsObject(v) Return "对象" Return v="" || [v].GetCapacity(1) ? "字符串" : InStr(v,".") ? "浮点数" : "整数" } sishe,3=Round(3.14) sishew,3=Round(3.14) sishewu,3=Round(3.14) sishewur,3=Round(3.14) sishewuru,3=Round(3.14) sjian,3=Shift sjian,4=+ sous,3=StrReplace(被替换, "搜索内容", "替换成") sousu,3=StrReplace(被替换, "搜索内容", "替换成") sousuo,3=StrReplace(被替换, "搜索内容", "替换成") souz,3=InStr(搜字符, "是否存在") souz,4=SubStr("截取指定字符", 2, 2) souz,5=StrSplit(分割取第二行, "`n") souzi,3=InStr(搜字符, "是否存在") souzi,4=SubStr("截取指定字符", 2, 2) souzi,5=StrSplit(分割取第二行, "`n") suij,3=Random, 随机数生成, 1, 9999 suij,4= Loop % 10 数字随排 .= A_Index " " Sort, 数字随排, D N Random For _, Index in 数字随排:=StrSplit(RTrim(数字随排)," ") MsgBox % "随机排序读取:" Index suiji,3=Random, 随机数生成, 1, 9999 suiji,4= Loop % 10 数字随排 .= A_Index " " Sort, 数字随排, D N Random For _, Index in 数字随排:=StrSplit(RTrim(数字随排)," ") MsgBox % "随机排序读取:" Index swi,1=Switch swi,3= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } swit,1=Switch swit,3= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } switc,1=Switch switc,3= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } switch,1=Switch switch,3= Switch 判断字符串变量 { Case "一行写法" : MsgBox 匹配跳转到"一行写法" Case "多行写法" : Sleep 1000 MsgBox 匹配跳转到"多行写法" Return } t,3= #NoEnv t,4= #NoTrayIcon t,5= #SingleInstance Force t,6= #SingleInstance Ignore t,7=SetWorkingDir %A_ScriptDir% t,8= #Include %A_ScriptDir%\FindText.ahk t,9=SendMode Input tab,3= tab,4=Gui Add, Tab3, , Tab1|Tab2 tanc,3=MsgBox tanch,3=MsgBox tanchu,3=MsgBox tanchua,3=MsgBox tanchuan,3=MsgBox tanchuang,3=MsgBox tiaoc,3=Break tiaoc,4=Until A_Index:=5 ; 循环=5 tiaoc,5=IfNotEqual,6,% 一行跳 := 1, Break tiaoch,3=Break tiaoch,4=Until A_Index:=5 ; 循环=5时跳出 tiaoch,5=IfNotEqual,6,% 一行跳 := 1, Break tiaochu,3=Break tiaochu,4=Until A_Index:=5 ; 循环=5时跳出 tiaochu,5=IfNotEqual,6,% 一行跳 := 1, Break tiaos,3=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 tiaos,4=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 tiaos,5=Progress % "x32 y22 fs22 CW101010 CTFFFFFF B zh0 ZY20 w" 40*StrLen(_:="用于状态提示"),%_%,,,Microsoft YaHei tiaos,6=InputBox, 输入变量, 修改调试变量值, 请输入变量值, , 280, 140, , , Locale, , 默认值 tiaos,7=MsgBox,,, 调试内容带超时, 2 tiaos,8= Loop { Sleep 10 ToolTip 持续运算演示-%A_Index% } tiaosh,3=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 tiaosh,4=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 tiaosh,5=Progress % "x32 y22 fs22 CW101010 CTFFFFFF B zh0 ZY20 w" 40*StrLen(_:="用于状态提示"),%_%,,,Microsoft YaHei tiaosh,6=InputBox, 输入变量, 修改调试变量值, 请输入变量值, , 280, 140, , , Locale, , 默认值 tiaosh7=MsgBox,,, 调试内容带超时, 2 tiaosh,8= Loop { Sleep 10 ToolTip 持续运算演示-%A_Index% } tiaoshi,3=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 tiaoshi,4=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 tiaoshi,5=Progress % "x32 y22 fs22 CW101010 CTFFFFFF B zh0 ZY20 w" 40*StrLen(_:="用于状态提示"),%_%,,,Microsoft YaHei tiaoshi,6=InputBox, 输入变量, 修改调试变量值, 请输入变量值, , 280, 140, , , Locale, , 默认值 tiaoshi,7=MsgBox,,, 调试内容带超时, 2 tiaoshi,8= Loop { Sleep 10 ToolTip 持续运算演示-%A_Index% } tiaoz,3=SetTimer 标签名, -1 tiaoz,4=Gosub tiaoz,5=Goto tiaozh,3=SetTimer 标签名, -1 tiaozh,4=Gosub tiaozh,5=Goto tiaozhu,3=SetTimer 标签名, -1 tiaozhu,4=Gosub tiaozhu,5=Goto tiaozhua,3=SetTimer 标签名, -1 tiaozhua,4=Gosub tiaozhua,5=Goto tiaozhuan,3=SetTimer 标签名, -1 tiaozhuan,4=Gosub tiaozhuan,5=Goto tih,3=StrReplace(变量, "搜索内容", "替换成") tih,4=StringReplace, Clipboard, Clipboard, `r`n, , All tih,5=RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") tih,6=StrReplace(检查变量, "1", , 替换1的次数) tihu,3=StrReplace(变量, "搜索内容", "替换成") tihu,4=StringReplace, Clipboard, Clipboard, `r`n, , All tihu,5=RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") tihu,6=StrReplace(检查变量, "1", , 替换1的次数) tihua,3=StrReplace(变量, "搜索内容", "替换成") tihua,4=StringReplace, Clipboard, Clipboard, `r`n, , All tihua,5=RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") tihua,6=StrReplace(检查变量, "1", , 替换1的次数) tihuan,3=StrReplace(变量, "搜索内容", "替换成") tihuan,4=StringReplace, Clipboard, Clipboard, `r`n, , All tihuan,5=RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") tihuan,6=StrReplace(检查变量, "1", , 替换1的次数) tij,3=submit() tiji,3=submit() tijia,3=submit() tijiao,3=submit() tip,3= Tip(s:="", Period:="") { SetTimer %A_ThisFunc%, % s="" ? "Off" : "-" (Period="" ? 1500 : Period) ToolTip %s%, , , 17 } tiq,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 tiqu,3=SplitPath, 要提取的变量名, 文件名, 文件路径, 后缀名, 文件名不带后缀, 所在盘符 tis,3=ToolTip tish,3=ToolTip tishi,3=ToolTip tishiy,3=SoundPlay *-1 tishiy,4=SoundBeep tishiyi,3=SoundPlay *-1 tishiyi,4=SoundBeep tishiyin,3=SoundPlay *-1 tishiyin,4=SoundBeep to,3= #NoEnv to,4= #NoTrayIcon to,5= #SingleInstance Force to,6= #SingleInstance Ignore to,7=SetWorkingDir %A_ScriptDir% to,8= #Include %A_ScriptDir%\FindText.ahk to,9=SendMode Input tool,1=ToolTip tool,2=MsgBox tool,3=ToolTip 显示内容 ,300, 78 tool,4= Tip(s:="", Period:="") { SetTimer %A_ThisFunc%, % s="" ? "Off" : "-" (Period="" ? 1500 : Period) ToolTip %s%, , , 17 } tool,5=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 tool,6=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 toolt,1=ToolTip toolt,2=MsgBox toolt,3=ToolTip 显示内容 ,300, 78 toolt,4= Tip(s:="", Period:="") { SetTimer %A_ThisFunc%, % s="" ? "Off" : "-" (Period="" ? 1500 : Period) ToolTip %s%, , , 17 } toolt,5=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 toolt,6=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 toolti,1=ToolTip toolti,2=MsgBox toolti,3=ToolTip 显示内容 ,300, 78 toolti,4= Tip(s:="", Period:="") { SetTimer %A_ThisFunc%, % s="" ? "Off" : "-" (Period="" ? 1500 : Period) ToolTip %s%, , , 17 } toolti,5=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 toolti,6=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 tooltip,1=ToolTip tooltip,2=MsgBox tooltip,3=ToolTip 显示内容 ,300, 78 tooltip,4= Tip(s:="", Period:="") { SetTimer %A_ThisFunc%, % s="" ? "Off" : "-" (Period="" ? 1500 : Period) ToolTip %s%, , , 17 } tooltip,5=ToolTip CoordMode ToolTip`n右下显示+0.5换行, A_ScreenWidth, A_ScreenHeight//1.1, 11 tooltip,6=ToolTip % 调试显示:="CoordMode ToolTip`n右下显示" ,A_ScreenWidth RegExReplace(调试显示, "[^\r\n]*\S",,调试行数), A_ScreenHeight//(1.08+调试行数*0.015), 11 tong,3=StrReplace(检查变量, "1", , 替换1的次数) tongj,3=StrReplace(检查变量, "1", , 替换1的次数) tongji,3=StrReplace(检查变量, "1", , 替换1的次数) tou,3= #NoEnv tou,4= #NoTrayIcon tou,5= #SingleInstance Force tou,6= #SingleInstance Ignore tou,7=SetWorkingDir %A_ScriptDir% tou,8= #Include %A_ScriptDir%\FindText.ahk tou,9= #NoEnv #KeyHistory 0 #SingleInstance Force SetBatchLines -1 ListLines Off toum,3=WinSet, Transparent, 0, ahk_class 窗口全透明 toumi,3=WinSet, Transparent, 0, ahk_class 窗口全透明 toumin,3=WinSet, Transparent, 0, ahk_class 窗口全透明 touming,3=WinSet, Transparent, 0, ahk_class 窗口全透明 tray,1=TrayTip trayt,1=TrayTip trayti,1=TrayTip traytip,1=TrayTip tr,1=True tru,1=True true,1=True tup,3=hIcon := LoadPicture("netshell.dll", "Icon154", _) tup,4=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tup,5=Menu Tray, Icon, HBITMAP:*%hBitmap% tup,6= Gui hBM_调试: Destroy Gui hBM_调试: +LastFound -Resize Gui hBM_调试: Margin, 0, 0 Gui hBM_调试: Add, Picture, , HBITMAP:*%hBitmap% Gui hBM_调试: Show, X5 Y5 AutoSize, hBitmap调试-hBM tup,7=pBitmap := Gdip_CreateBitmapFromHBITMAP(hBitmap) tup,8=hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap) tupi,3=hIcon := LoadPicture("netshell.dll", "Icon154", _) tupi,4=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tupi,5=Menu Tray, Icon, HBITMAP:*%hBitmap% tupi,6= Gui hBM_调试: Destroy Gui hBM_调试: +LastFound -Resize Gui hBM_调试: Margin, 0, 0 Gui hBM_调试: Add, Picture, , HBITMAP:*%hBitmap% Gui hBM_调试: Show, X5 Y5 AutoSize, hBitmap调试-hBM tupi,7=pBitmap := Gdip_CreateBitmapFromHBITMAP(hBitmap) tupi,8=hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap) tupia,3=hIcon := LoadPicture("netshell.dll", "Icon154", _) tupia,4=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tupia,5=Menu Tray, Icon, HBITMAP:*%hBitmap% tupia,6= Gui hBM_调试: Destroy Gui hBM_调试: +LastFound -Resize Gui hBM_调试: Margin, 0, 0 Gui hBM_调试: Add, Picture, , HBITMAP:*%hBitmap% Gui hBM_调试: Show, X5 Y5 AutoSize, hBitmap调试-hBM tupia,7=pBitmap := Gdip_CreateBitmapFromHBITMAP(hBitmap) tupia,8=hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap) tupian,3=hIcon := LoadPicture("netshell.dll", "Icon154", _) tupian,4=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tupian,5=Menu Tray, Icon, HBITMAP:*%hBitmap% tupian,6= Gui hBM_调试: Destroy Gui hBM_调试: +LastFound -Resize Gui hBM_调试: Margin, 0, 0 Gui hBM_调试: Add, Picture, , HBITMAP:*%hBitmap% Gui hBM_调试: Show, X5 Y5 AutoSize, hBitmap调试-hBM tupian,7=pBitmap := Gdip_CreateBitmapFromHBITMAP(hBitmap) tupian,8=hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap) tub,3= #NoTrayIcon tub,4=Menu, Tray, NoIcon tubi,3= #NoTrayIcon tubi,4=Menu, Tray, NoIcon tubia,3= #NoTrayIcon tubia,4=Menu, Tray, NoIcon tubiao,3= #NoTrayIcon tubiao,4=Menu, Tray, NoIcon tuic,3=ExitApp tuic,4= OnExit, 退出脚本时调用 退出脚本时调用: ExitApp ; 脚本含有 OnExit 子程序时不会终止, 除非子程序使用 ExitApp tuic,5= Menu, Tray, NoIcon Process, Close, % DllCall("GetCurrentProcessId") tuich,3=ExitApp tuich,4= OnExit, 退出脚本时调用 退出脚本时调用: ExitApp ; 脚本含有 OnExit 子程序时不会终止, 除非子程序使用 ExitApp tuich,5= Menu, Tray, NoIcon Process, Close, % DllCall("GetCurrentProcessId") tuichu,3=ExitApp tuichu,4= OnExit, 退出脚本时调用 退出脚本时调用: ExitApp ; 脚本含有 OnExit 子程序时不会终止, 除非子程序使用 ExitApp tuichu,5= Menu, Tray, NoIcon Process, Close, % DllCall("GetCurrentProcessId") tuig,3=Backspace tuige,3=Backspace tuop,3= 加载托盘菜单: Menu Tray, NoStandard Menu Tray, Add, 编辑脚本(&E), 编辑脚本 Menu Tray, Icon, 编辑脚本(&E), C:\Windows\System32\notepad.exe, 1, 16 Menu Tray, Add Menu Tray, Add, 重启脚本(&R), 重启脚本 Menu Tray, Icon, 重启脚本(&R), shell32.dll, 239, 16 Menu Tray, Add Menu Tray, Add, 关闭脚本(&X), GuiClose Menu Tray, Icon, 关闭脚本(&X), shell32.dll, 132, 16 Menu Tray, Color, FFFFFF Menu Tray, Default, 关闭脚本(&X) Return GuiClose() { ExitApp } 重启脚本() { Reload } 编辑脚本() { Edit } tuop,4=Menu Tray, Tip, 悬停托盘图标显示指定文字 tuop,5=Menu Tray, Icon, shell32.dll, 42 tuop,6=Menu Tray, Icon, HICON:*%Hicon% tuop,7=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tuop,8=Menu Tray, Delete, Exit tuop,9=Menu Tray, Click, 1 tuopa,3= 加载托盘菜单: Menu Tray, NoStandard Menu Tray, Add, 编辑脚本(&E), 编辑脚本 Menu Tray, Icon, 编辑脚本(&E), C:\Windows\System32\notepad.exe, 1, 16 Menu Tray, Add Menu Tray, Add, 重启脚本(&R), 重启脚本 Menu Tray, Icon, 重启脚本(&R), shell32.dll, 239, 16 Menu Tray, Add Menu Tray, Add, 关闭脚本(&X), GuiClose Menu Tray, Icon, 关闭脚本(&X), shell32.dll, 132, 16 Menu Tray, Color, FFFFFF Menu Tray, Default, 关闭脚本(&X) Return GuiClose() { ExitApp } 重启脚本() { Reload } 编辑脚本() { Edit } tuopa,4=Menu Tray, Tip, 悬停托盘图标显示指定文字 tuopa,5=Menu Tray, Icon, shell32.dll, 42 tuopa,6=Menu Tray, Icon, HICON:*%Hicon% tuopa,7=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tuopa,8=Menu Tray, Delete, Exit tuopa,9=Menu Tray, Click, 1 tuopan,3= 加载托盘菜单: Menu Tray, NoStandard Menu Tray, Add, 编辑脚本(&E), 编辑脚本 Menu Tray, Icon, 编辑脚本(&E), C:\Windows\System32\notepad.exe, 1, 16 Menu Tray, Add Menu Tray, Add, 重启脚本(&R), 重启脚本 Menu Tray, Icon, 重启脚本(&R), shell32.dll, 239, 16 Menu Tray, Add Menu Tray, Add, 关闭脚本(&X), GuiClose Menu Tray, Icon, 关闭脚本(&X), shell32.dll, 132, 16 Menu Tray, Color, FFFFFF Menu Tray, Default, 关闭脚本(&X) Return GuiClose() { ExitApp } 重启脚本() { Reload } 编辑脚本() { Edit } tuopan,4=Menu Tray, Tip, 悬停托盘图标显示指定文字 tuopan,5=Menu Tray, Icon, shell32.dll, 42 tuopan,6=Menu Tray, Icon, HICON:*%Hicon% tuopan,7=hBitmap := LoadPicture("netshell.dll", "Icon154 w128 h128") tuopan,8=Menu Tray, Delete, Exit tuopan,9=Menu Tray, Click, 1 weir,3=Microsoft YaHei UI weir,4=Segoe UI weiru,3=Microsoft YaHei UI weiru,4=Segoe UI weirua,3=Microsoft YaHei UI weirua,4=Segoe UI weiruan,3=Microsoft YaHei UI weiruan,4=Segoe UI weis,3=A_PtrSize * 8 weish,3=A_PtrSize * 8 weishu,3=A_PtrSize * 8 wenb,3=InStr(搜字符, "是否存在") wenb,4=SubStr("截取指定字符", 2, 2) wenb,5=StrSplit(分割取第二行, "`n") wenb,6=StrReplace(被替换, "搜索内容", "替换成") wenb,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 wenb,8=textContent wenb,9=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor wenbe,3=InStr(搜字符, "是否存在") wenbe,4=SubStr("截取指定字符", 2, 2) wenbe,5=StrSplit(分割取第二行, "`n") wenbe,6=StrReplace(被替换, "搜索内容", "替换成") wenbe,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 wenbe,8=textContent wenbe,9=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor wenben,3=InStr(搜字符, "是否存在") wenben,4=SubStr("截取指定字符", 2, 2) wenben,5=StrSplit(分割取第二行, "`n") wenben,6=StrReplace(被替换, "搜索内容", "替换成") wenben,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 wenben,8=textContent wenben,9=ControlSetText, Edit1, 修改内容, ahk_class AHKEditor wenj,2=if FileExist("文件存在") wenj,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt wenj,4=FileDelete, %A_ScriptDir%\FileRemoveDir是删除文件夹.txt wenj,5=FileCreateDir, 创建文件夹【例如:D:\ahk】 wenj,6=FileRead, 读取文件到变量, D:\My File.txt wenj,7=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ wenj,8=FileCopy, D:\复制文件.txt, D:\FileCopyDir是复制文件夹.txt, 1 wenj,9=FileEncoding UTF-8 wenji,2=if FileExist("文件存在") wenji,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt wenji,4=FileDelete, %A_ScriptDir%\FileRemoveDir是删除文件夹.txt wenji,5=FileCreateDir, 创建文件夹【例如:D:\ahk】 wenji,6=FileRead, 读取文件到变量, D:\My File.txt wenji,7=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ wenji,8=FileCopy, D:\复制文件.txt, D:\FileCopyDir是复制文件夹.txt, 1 wenji,9=FileEncoding UTF-8 wenjia,2=if FileExist("文件存在") wenjia,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt wenjia,4=FileDelete, %A_ScriptDir%\FileRemoveDir是删除文件夹.txt wenjia,5=FileCreateDir, 创建文件夹【例如:D:\ahk】 wenjia,6=FileRead, 读取文件到变量, D:\My File.txt wenjia,7=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ wenjia,8=FileCopy, D:\复制文件.txt, D:\FileCopyDir是复制文件夹.txt, 1 wenjia,9=FileEncoding UTF-8 wenjian,2=if FileExist("文件存在") wenjian,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt wenjian,4=FileDelete, %A_ScriptDir%\FileRemoveDir是删除文件夹.txt wenjian,5=FileCreateDir, 创建文件夹【例如:D:\ahk】 wenjian,6=FileRead, 读取文件到变量, D:\My File.txt wenjian,7=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ wenjian,8=FileCopy, D:\复制文件.txt, D:\FileCopyDir是复制文件夹.txt, 1 wenjian,9=FileEncoding UTF-8 wenjianj,3=完整路径名A_LoopFileFullPath wenjianj,4=文件名后缀A_LoopFileName wenjianj,5=Loop Files, %文件%\*.*, F wenjianj,6=Loop Files, %文件夹%\*.*, D wenjianj,7=Loop Files, %递归子目录%\*.*, R wenjianji,3=完整路径名A_LoopFileFullPath wenjianji,4=文件名后缀A_LoopFileName wenjianji,5=Loop Files, %文件%\*.*, F wenjianji,6=Loop Files, %文件夹%\*.*, D wenjianji,7=Loop Files, %递归子目录%\*.*, R wenjianjia,3=完整路径名A_LoopFileFullPath wenjianjia,4=文件名后缀A_LoopFileName wenjianjia,5=Loop Files, %文件%\*.*, F wenjianjia,6=Loop Files, %文件夹%\*.*, D wenjianjia,7=Loop Files, %递归子目录%\*.*, R wenjj,3=完整路径名A_LoopFileFullPath wenjj,4=文件名后缀A_LoopFileName wenjj,5=Loop Files, %文件%\*.*, F wenjj,6=Loop Files, %文件夹%\*.*, D wenjj,7=Loop Files, %递归子目录%\*.*, R win,1=Win wjian,3=Win wjian,4=# wp,3=WordPress xiaoshu,3=Format("{:d}", 124.21) xiaoshu,4=Round(3.14) xiaoshud,3=Format("{:d}", 124.21) xiaoshud,4=Round(3.14) xiaoshudi,3=Format("{:d}", 124.21) xiaoshudi,4=Round(3.14) xiaoshudia,3=Format("{:d}", 124.21) xiaoshudia,4=Round(3.14) xiaoshudian,3=Format("{:d}", 124.21) xiaoshudian,4=Round(3.14) xiaox,3= ; 大写转小写 Format("{:L}", "LOWER") xiaox,4= ; 小写转大写 Format("{:U}", "upper") xiaoxi,3= ; 大写转小写 Format("{:L}", "LOWER") xiaoxi,4= ; 小写转大写 Format("{:U}", "upper") xiaoxie,3= ; 大写转小写 Format("{:L}", "LOWER") xiaoxie,4= ; 小写转大写 Format("{:U}", "upper") xia,3=Down xiaz,3=UrlDownloadToFile, https://www.autohotkey.com/download/1.1/version.txt, D:\AHK.txt xiaz,4= ; 下载文本到变量 whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") whr.Open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) whr.Send() whr.WaitForResponse() 文本到变量 := whr.ResponseText MsgBox % 文本到变量 xiaz,5= ; 发出异步 HTTP 请求 req := ComObjCreate("Msxml2.XMLHTTP") req.open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) req.onreadystatechange := Func("Ready") req.send() #Persistent Ready() { global req if (req.readyState != 4) ; 没有完成. Return if (req.status == 200) ; 完成. MsgBox % "最新AutoHotkey版本:" req.responseText else MsgBox 16,, % "状态 " req.status ExitApp } xiaza,3=UrlDownloadToFile, https://www.autohotkey.com/download/1.1/version.txt, D:\AHK.txt xiaza,4= ; 下载文本到变量 whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") whr.Open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) whr.Send() whr.WaitForResponse() 文本到变量 := whr.ResponseText MsgBox % 文本到变量 xiaza,5= ; 发出异步 HTTP 请求 req := ComObjCreate("Msxml2.XMLHTTP") req.open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) req.onreadystatechange := Func("Ready") req.send() #Persistent Ready() { global req if (req.readyState != 4) ; 没有完成. Return if (req.status == 200) ; 完成. MsgBox % "最新AutoHotkey版本:" req.responseText else MsgBox 16,, % "状态 " req.status ExitApp } xiazai,3=UrlDownloadToFile, https://www.autohotkey.com/download/1.1/version.txt, D:\AHK.txt xiazai,4= ; 下载文本到变量 whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") whr.Open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) whr.Send() whr.WaitForResponse() 文本到变量 := whr.ResponseText MsgBox % 文本到变量 xiazai,5= ; 发出异步 HTTP 请求 req := ComObjCreate("Msxml2.XMLHTTP") req.open("GET", "https://www.autohotkey.com/download/1.1/version.txt", true) req.onreadystatechange := Func("Ready") req.send() #Persistent Ready() { global req if (req.readyState != 4) ; 没有完成. Return if (req.status == 200) ; 完成. MsgBox % "最新AutoHotkey版本:" req.responseText else MsgBox 16,, % "状态 " req.status ExitApp } xiangd,3=CoordMode Mouse xiangd,4=%A_ScriptDir% xiangd,5=CoordMode ToolTip xiangd,6=CoordMode Pixel xiangd,7=SetWorkingDir %A_ScriptDir% xiangdu,3=CoordMode Mouse xiangdu,4=%A_ScriptDir% xiangdu,5=CoordMode ToolTip xiangdu,6=CoordMode Pixel xiangdu,7=SetWorkingDir %A_ScriptDir% xiangdui,3=CoordMode Mouse xiangdui,4=%A_ScriptDir% xiangdui,5=CoordMode ToolTip xiangdui,6=CoordMode Pixel xiangdui,7=SetWorkingDir %A_ScriptDir% xians,3=Gui Show, , 窗口 xians,4=Gui Add, Slider, w1 h1 xiansh,3=Gui Show, , 窗口 xiansh,4=Gui Add, Slider, w1 h1 xianshi,3=Gui Show, , 窗口 xianshi,4=Gui Add, Slider, w1 h1 xier,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt xier,4= ; 写入多行内容【`%】 FileAppend, ( 支持多行文本 ), %A_ScriptDir%\test.txt xier,5=FileEncoding UTF-8 xier,6=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi xier,7=iniWrite, 写入内容, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 xier,8=GuiControl,, Edit1, %写入编辑框的内容% xieru,3=FileAppend, 写入内容, %A_ScriptDir%\test.txt xieru,4= ; 写入多行内容【`%】 FileAppend, ( 支持多行文本 ), %A_ScriptDir%\test.txt xieru,5=FileEncoding UTF-8 xieru,6=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi xieru,7=iniWrite, 写入内容, %A_ScriptDir%\my.ini, 段名_方括号中的标题短语, 键名 xieru,8=GuiControl,, Edit1, %写入编辑框的内容% xsf,3= # ; Win xsf,4=! ; Alt xsf,5=^ ; Ctrl xsf,6=+ ; Shift xianc,3=Critical ; Off xianc,4=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xianc,5=AhkThread(代码, 传参) xianch,3=Critical ; Off xianch,4=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xianch,5=AhkThread(代码, 传参) xianche,3=Critical ; Off xianche,4=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xianche,5=AhkThread(代码, 传参) xianchen,3=Critical ; Off xianchen,4=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xianchen,5=AhkThread(代码, 传参) xiancheng,3=Critical ; Off xiancheng,4=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xiancheng,5=AhkThread(代码, 传参) xianz,3=BlockInput On ; 阻止键鼠 xianz,4=BlockInput, MouseMove ; 阻止鼠标 xianz,5=BlockInput, MouseMoveOff ; 允许鼠标 xianzh,3=BlockInput On ; 阻止键鼠 xianzh,4=BlockInput, MouseMove ; 阻止鼠标 xianzh,5=BlockInput, MouseMoveOff ; 允许鼠标 xianzhi,3=BlockInput On ; 阻止键鼠 xianzhi,4=BlockInput, MouseMove ; 阻止鼠标 xianzhi,5=BlockInput, MouseMoveOff ; 允许鼠标 xinj,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 xinj,4=FileAppend, 写入内容, %A_ScriptDir%\test.txt xinji,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 xinji,4=FileAppend, 写入内容, %A_ScriptDir%\test.txt xinjia,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 xinjia,4=FileAppend, 写入内容, %A_ScriptDir%\test.txt xinjian,3=FileCreateDir, 创建文件夹【例如:D:\ahk】 xinjian,4=FileAppend, 写入内容, %A_ScriptDir%\test.txt xinjin,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xinjinc,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xinjinch,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xinjinche,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xinjinchen,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xinjincheng,3=DynaRun(进程代码, "Exec", DllCall("GetCurrentProcessId")) xit,3=(A_Is64bitOS ? 64 : 32) xito,3=(A_Is64bitOS ? 64 : 32) xiton,3=(A_Is64bitOS ? 64 : 32) xitong,3=(A_Is64bitOS ? 64 : 32) xiushif,3= # ; Win xiushif,4=! ; Alt xiushif,5=^ ; Ctrl xiushif,6=+ ; Shift xiushifu,3= # ; Win xiushifu,4=! ; Alt xiushifu,5=^ ; Ctrl xiushifu,6=+ ; Shift xo,3=ХОЯ xor,3=ХОЯ xuanz,3=FileSelectFile, 变量, , ,选择要启动的程序,*.exe xuanz,4= FileSelectFolder, 变量, , 3 if 变量 = MsgBox 你没有选择一个文件夹 else MsgBox 你选择的文件夹 "%OutputVar%" xuanz,5=Checked1 xuanze,3=FileSelectFile, 变量, , ,选择要启动的程序,*.exe xuanze,4= FileSelectFolder, 变量, , 3 if 变量 = MsgBox 你没有选择一个文件夹 else MsgBox 你选择的文件夹 "%OutputVar%" xuanzh,5=Checked1 xuanzho,5=Checked1 xuanzhon,5=Checked1 xuanzhong,5=Checked1 xunh,3=Loop xunhu,3=Loop xunhua,3=Loop xunhuan,3=Loop yan,3= Format(" ( 主字符串逻辑 {1} 可换行 {2} )", "可函数拼接1", "参数编号延续2") yanx,3= Format(" ( 主字符串逻辑 {1} 可换行 {2} )", "可函数拼接1", "参数编号延续2") yanxu,3= Format(" ( 主字符串逻辑 {1} 可换行 {2} )", "可函数拼接1", "参数编号延续2") yang,3=IBStyle() yang,4=IBStyle(0) ; 批量所有 yang,5=IBStyle(0, , , "White") yang,6=Gui, Color, White yangs,3=IBStyle() yangs,4=IBStyle(0) ; 批量所有 yangs,5=IBStyle(0, , , "White") yangs,6=Gui, Color, White yangsh,3=IBStyle() yangsh,4=IBStyle(0) ; 批量所有 yangsh,5=IBStyle(0, , , "White") yangsh,6=Gui, Color, White yangshi,3=IBStyle() yangshi,4=IBStyle(0) ; 批量所有 yangshi,5=IBStyle(0, , , "White") yangshi,6=Gui, Color, White yans,3=Sleep 200 yans,4=Sleep 500 yans,5=Sleep 1000 yans,6=DllCall("Sleep", "UInt", 9) yansh,3=Sleep 200 yansh,4=Sleep 500 yansh,5=Sleep 1000 yansh,6=DllCall("Sleep", "UInt", 9) yanshi,3=Sleep 200 yanshi,4=Sleep 500 yanshi,5=Sleep 1000 yanshi,6=DllCall("Sleep", "UInt", 9) yib,3= ; AHK窗口切换钩子调用 DllCall("RegisterShellHookWindow", "Ptr", A_ScriptHwnd) OnMessage(DllCall("RegisterWindowMessage", "Str", "ShellHook"), "ShellEvent") ShellEvent(wParam, lParam) { Static a=0 ToolTip % "切换窗口是触发 " a+=1 } yib,4= if p is Number { ; 函数参数加上p:=50,可实现异步启动函数。!s例:Asynchronous(p:=50) SetTimer %s%, % "-" p s:=Func(A_ThisFunc).Bind("Asynchronous") Return } yibu,3= ; AHK窗口切换钩子调用 DllCall("RegisterShellHookWindow", "Ptr", A_ScriptHwnd) OnMessage(DllCall("RegisterWindowMessage", "Str", "ShellHook"), "ShellEvent") ShellEvent(wParam, lParam) { Static a=0 ToolTip % "切换窗口是触发 " a+=1 } yibu,4= if p is Number { ; 函数参数加上p:=50,可实现异步启动函数。!s例:Asynchronous(p:=50) SetTimer %s%, % "-" p s:=Func(A_ThisFunc).Bind("Asynchronous") Return } yid,3=MouseMove, 12, 34, 0 yid,4=WinMove, ahk_class 移动窗口,, x, y, w, h yid,5=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ yido,3=MouseMove, 12, 34, 0 yido,4=WinMove, ahk_class 移动窗口,, x, y, w, h yido,5=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ yidon,3=MouseMove, 12, 34, 0 yidon,4=WinMove, ahk_class 移动窗口,, x, y, w, h yidon,5=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ yidong,3=MouseMove, 12, 34, 0 yidong,4=WinMove, ahk_class 移动窗口,, x, y, w, h yidong,5=FileMove, D:\移动文件.txt, D:\FileMoveDir是移动文件夹\ yinc,3=, , Hide yinc,4=WinSet, Transparent, 0, ahk_class 窗口全透明 yinc,5=WinHide ahk_class 隐藏窗口 yinc,6=WinShow ahk_class 显示窗口 yinc,7=Submit保存并隐藏窗口 yinc,8=DetectHiddenWindows On yinc,9=Gui Show, Hide, <<ExecScriptHwnd>> yinca,3=, , Hide yinca,4=WinSet, Transparent, 0, ahk_class 窗口全透明 yinca,5=WinHide ahk_class 隐藏窗口 yinca,6=WinShow ahk_class 显示窗口 yinca,7=Submit保存并隐藏窗口 yinca,8=DetectHiddenWindows On yinca,9=Gui Show, Hide, <<ExecScriptHwnd>> yincan,3=, , Hide yincan,4=WinSet, Transparent, 0, ahk_class 窗口全透明 yincan,5=WinHide ahk_class 隐藏窗口 yincan,6=WinShow ahk_class 显示窗口 yincan,7=Submit保存并隐藏窗口 yincan,8=DetectHiddenWindows On yincan,9=Gui Show, Hide, <<ExecScriptHwnd>> yincang,3=, , Hide yincang,4=WinSet, Transparent, 0, ahk_class 窗口全透明 yincang,5=WinHide ahk_class 隐藏窗口 yincang,6=WinShow ahk_class 显示窗口 yincang,7=Submit保存并隐藏窗口 yincang,8=DetectHiddenWindows On yincang,9=Gui Show, Hide, <<ExecScriptHwnd>> yixiaos,3=3600000 yixiaosh,3=3600000 yixiaoshi,3=3600000 yunx,3=Run yunxi,3=Run yunxin,3=Run yunxing,3=Run yong,3=if (A_UserName="dbgba") yongh,3=if (A_UserName="dbgba") yonghu,3=if (A_UserName="dbgba") you,3=Right youj,3=RButton youj,4= LV列表鼠标回调(CtrlHwnd, GuiEvent) { Global LVHwnd if (A_GuiEvent="RightClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 右击 else if (A_GuiEvent="DoubleClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 双击 } youji,3=RButton youji,4= LV列表鼠标回调(CtrlHwnd, GuiEvent) { Global LVHwnd if (A_GuiEvent="RightClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 右击 else if (A_GuiEvent="DoubleClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 双击 } youjia,3=RButton youjia,4= LV列表鼠标回调(CtrlHwnd, GuiEvent) { Global LVHwnd if (A_GuiEvent="RightClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 右击 else if (A_GuiEvent="DoubleClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 双击 } youjian,3=RButton youjian,4= LV列表鼠标回调(CtrlHwnd, GuiEvent) { Global LVHwnd if (A_GuiEvent="RightClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 右击 else if (A_GuiEvent="DoubleClick" && CtrlHwnd = LVHwnd && LV_GetNext()) ToolTip 双击 } yu,3=&& yu,4=and yuy,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") yuyi,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") yuyin,3=ComObjCreate("SAPI.SpVoice").Speak("语音播报") zant,3=Pause zanti,3=Pause zantin,3=Pause zanting,3=Pause zhaot,3= CoordMode Pixel ; 设置找图坐标系为全屏找图 ImageSearch, 返回坐标X, 返回坐标Y, 0, 0, A_ScreenWidth, A_ScreenHeight, D:/截图.png if (ErrorLevel=0) { ; 如果没有报错就执行,=1是没找到 =2是其他错误 MsgBox 找到了,X坐标:%返回坐标X%,Y坐标:%返回坐标Y% } else { MsgBox 没找到 } zhaotu,3= CoordMode Pixel ; 设置找图坐标系为全屏找图 ImageSearch, 返回坐标X, 返回坐标Y, 0, 0, A_ScreenWidth, A_ScreenHeight, D:/截图.png if (ErrorLevel=0) { ; 如果没有报错就执行,=1是没找到 =2是其他错误 MsgBox 找到了,X坐标:%返回坐标X%,Y坐标:%返回坐标Y% } else { MsgBox 没找到 } zhaos,3= ; AHK单点取色比较 CoordMode Pixel ; 设置取色坐标系为全屏取色 if (GetColor(123,456)="0xFFFFFF") MsgBox 颜色匹配时触发 GetColor(x,y) { PixelGetColor, color, x, y, Fast RGB ; ToolTip % "该坐标点的颜色值为:" color Return color } zhaos,4= ; AHK屏幕找色 CoordMode Pixel ; 设置找色坐标系为全屏找色 PixelSearch, Px, Py, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xFFFFFF, 0, Fast RGB if ErrorLevel MsgBox 未在指定区域中找到该颜色 else MsgBox 该颜色的坐标为 X%Px% Y%Py% zhaose,3= ; AHK单点取色比较 CoordMode Pixel ; 设置取色坐标系为全屏取色 if (GetColor(123,456)="0xFFFFFF") MsgBox 颜色匹配时触发 GetColor(x,y) { PixelGetColor, color, x, y, Fast RGB ; ToolTip % "该坐标点的颜色值为:" color Return color } zhaose,4= ; AHK屏幕找色 CoordMode Pixel ; 设置找色坐标系为全屏找色 PixelSearch, Px, Py, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xFFFFFF, 0, Fast RGB if ErrorLevel MsgBox 未在指定区域中找到该颜色 else MsgBox 该颜色的坐标为 X%Px% Y%Py% zhen,3=True zhengz,2=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zhengz,3= ; 提取数字清除其它 RegExReplace("2020年12月31日", "\D")+0 zhengz,4= ; 留小数点后两位 Format("{:.2f}", 123) ; 123.00 zhengz,5= ; 保留整数 Format("{:d}", 1.23) ; 1 zhengz,6= ; 补齐N位数字 Format("{:04d}", 78) ; 0078 zhengz,7= ; 删开头的数字和、 RegExReplace("1、测试", "m)(*ANYCRLF)^\d+?、") ; 返回:测试 zhengz,8= ; 四舍五入后取整 Round(3.14) zhengz,9= ; 多项替换 RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") zhengze,2=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zhengze,3= ; 提取数字清除其它 RegExReplace("2020年12月31日", "\D")+0 zhengze,4= ; 留小数点后两位 Format("{:.2f}", 123) ; 123.00 zhengze,5= ; 保留整数 Format("{:d}", 1.23) ; 1 zhengze,6= ; 补齐N位数字 Format("{:04d}", 78) ; 0078 zhengze,7= ; 删开头的数字和、 RegExReplace("1、测试", "m)(*ANYCRLF)^\d+?、") ; 返回:测试 zhengze,8= ; 四舍五入后取整 Round(3.14) zhengze,9= ; 多项替换 RegExReplace(Str, "[\/\\\:\*\?\""\<\>\|?“” ]") zhid,3=AlwaysOnTop zhid,4=WinSet, AlwaysOnTop, On, ahk_class 窗口置顶 zhidi,3=AlwaysOnTop zhidi,4=WinSet, AlwaysOnTop, On, ahk_class 窗口置顶 zhidin,3=AlwaysOnTop zhidin,4=WinSet, AlwaysOnTop, On, ahk_class 窗口置顶 zhiding,3=AlwaysOnTop zhiding,4=WinSet, AlwaysOnTop, On, ahk_class 窗口置顶 zhidu,3=FileSetAttrib, -R+A, %A_ScriptFullPath% zhognduan,3=Break zhognduan,4=IfNotEqual,6,% 一行跳 := 1, Break zhognj,3=MButton zhognd,3=Break zhognd,4=IfNotEqual,6,% 一行跳 := 1, Break zhognduan,3=Break zhognduan,4=IfNotEqual,6,% 一行跳 := 1, Break zhongd,3=Break zhongd,4=IfNotEqual,6,% 一行跳 := 1, Break zhongdu,3=Break zhongdu,4=IfNotEqual,6,% 一行跳 := 1, Break zhongdua,3=Break zhongdua,4=IfNotEqual,6,% 一行跳 := 1, Break zhongduan,3=Break zhongduan,4=IfNotEqual,6,% 一行跳 := 1, Break zhongj,3=MButton zhongji,3=MButton zhongjia,3=MButton zhongjian,3=MButton zhuc,3=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu zhuc,4=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi zhuc,5=RegDelete, HKCU\Software\dbgba, JianMing zhuce,3=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu zhuce,4=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi zhuce,5=RegDelete, HKCU\Software\dbgba, JianMing zhuceb,3=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu zhuceb,4=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi zhuceb,5=RegDelete, HKCU\Software\dbgba, JianMing zhuced,3=RegRead, 读取到变量, HKCU\Software\dbgba, DuQu zhuces,3=RegDelete, HKCU\Software\dbgba, JianMing zhucex,3=RegWrite, REG_SZ, HKCU\Software\dbgba, JianMing, XieRuZhi zhur,3= ; H版编译后注入 if (A_Args[1]="") { SetWorkingDir %A_ScriptDir% RegWrite, REG_SZ, HKCU\Software\Temp, HuanYuanLuJing, %A_ScriptDir% BinRun(A_ScriptFullPath, "`n",,, "calc.exe") Return } else { RegRead, _, HKCU\Software\Temp, HuanYuanLuJing SetWorkingDir %_% ; 编译脚本需删除:SetWorkingDir %A_ScriptDir%,并将 A_ScriptDir 改为 A_WorkingDir } zhuru,3= ; H版编译后注入 if (A_Args[1]="") { SetWorkingDir %A_ScriptDir% RegWrite, REG_SZ, HKCU\Software\Temp, HuanYuanLuJing, %A_ScriptDir% BinRun(A_ScriptFullPath, "`n",,, "calc.exe") Return } else { RegRead, _, HKCU\Software\Temp, HuanYuanLuJing SetWorkingDir %_% ; 编译脚本需删除:SetWorkingDir %A_ScriptDir%,并将 A_ScriptDir 改为 A_WorkingDir } zid,3= 字典模板 := { "张三" : "1" , "李四" : "2" , "王五" : "3" } zidi,3= 字典模板 := { "张三" : "1" , "李四" : "2" , "王五" : "3" } zidia,3= 字典模板 := { "张三" : "1" , "李四" : "2" , "王五" : "3" } zidian,3= 字典模板 := { "张三" : "1" , "李四" : "2" , "王五" : "3" } zifuc,3=InStr(搜字符, "是否存在") zifuc,4=SubStr("截取指定字符", 2, 2) zifuc,5=StrSplit(分割取第二行, "`n") zifuc,6=StrReplace(被替换, "搜索内容", "替换成") zifuc,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zifuc,8=StrLen(统计字符数量) zifuc,9=LTrim("移除左边所有空格") zifuch,3=InStr(搜字符, "是否存在") zifuch,4=SubStr("截取指定字符", 2, 2) zifuch,5=StrSplit(分割取第二行, "`n") zifuch,6=StrReplace(被替换, "搜索内容", "替换成") zifuch,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zifuch,8=StrLen(统计字符数量) zifuch,9=LTrim("移除左边所有空格") zifuchu,3=InStr(搜字符, "是否存在") zifuchu,4=SubStr("截取指定字符", 2, 2) zifuchu,5=StrSplit(分割取第二行, "`n") zifuchu,6=StrReplace(被替换, "搜索内容", "替换成") zifuchu,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zifuchu,8=StrLen(统计字符数量) zifuchu,9=LTrim("移除左边所有空格") zifuchua,3=InStr(搜字符, "是否存在") zifuchua,4=SubStr("截取指定字符", 2, 2) zifuchua,5=StrSplit(分割取第二行, "`n") zifuchua,6=StrReplace(被替换, "搜索内容", "替换成") zifuchua,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zifuchua,8=StrLen(统计字符数量) zifuchua,9=LTrim("移除左边所有空格") zifuchuan,3=InStr(搜字符, "是否存在") zifuchuan,4=SubStr("截取指定字符", 2, 2) zifuchuan,5=StrSplit(分割取第二行, "`n") zifuchuan,6=StrReplace(被替换, "搜索内容", "替换成") zifuchuan,7=RegExReplace(A_AhkPath, "\\[^\\]+$") ; 只获取路径 zifuchuan,8=StrLen(统计字符数量) zifuchuan,9=LTrim("移除左边所有空格") zit,3=Gui Font, s9 Q5, Microsoft YaHei UI zit,4=Microsoft YaHei UI zit,5=Segoe UI ziti,3=Gui Font, s9 Q5, Microsoft YaHei UI ziti,4=Microsoft YaHei UI ziti,5=Segoe UI zis,3=StrLen(统计字符数量) zish,3=StrLen(统计字符数量) zishu,3=StrLen(统计字符数量) ziy,3=if (A_UserName="dbgba") ziyo,3=if (A_UserName="dbgba") ziyon,3=if (A_UserName="dbgba") ziyong,3=if (A_UserName="dbgba") zhanw,3=Format("w{} h{}", 123, "字符串") zhanwe,3=Format("w{} h{}", 123, "字符串") zhanwei,3=Format("w{} h{}", 123, "字符串") zhanweif,3=Format("w{} h{}", 123, "字符串") zhanweifu,3=Format("w{} h{}", 123, "字符串") zhuany,3=if (A_UserName="dbgba") zhuanyo,3=if (A_UserName="dbgba") zhuanyon,3=if (A_UserName="dbgba") zhuanyong,3=if (A_UserName="dbgba") zhuom,3=A_Desktop zhuom,4=A_DesktopCommon zhuomi,3=A_Desktop zhuomi,4=A_DesktopCommon zhuomia,3=A_Desktop zhuomia,4=A_DesktopCommon zhuomian,3=A_Desktop zhuomian,4=A_DesktopCommon zuidah,3=WinMaximize, ahk_class 最大化窗口 zuidah,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuidahu,3=WinMaximize, ahk_class 最大化窗口 zuidahu,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuidahua,3=WinMaximize, ahk_class 最大化窗口 zuidahua,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuixiaoh,3=WinMinimize, ahk_class 最小化窗口 zuixiaoh,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuixiaohu,3=WinMinimize, ahk_class 最小化窗口 zuixiaohu,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuixiaohua,3=WinMinimize, ahk_class 最小化窗口 zuixiaohua,4=PostMessage, 0x0112, 0xF120,,, ahk_class QQ ; 还原最大小化,类似WinRestore zuo,3=Left zuob,3=CoordMode Mouse zuob,4=CoordMode ToolTip zuob,5=CoordMode Pixel zuob,6=Gui Margin, 0, 0 zuob,7=AutoSize zuobi,3=CoordMode Mouse zuobi,4=CoordMode ToolTip zuobi,5=CoordMode Pixel zuobi,6=Gui Margin, 0, 0 zuobi,7=AutoSize zuobia,3=CoordMode Mouse zuobia,4=CoordMode ToolTip zuobia,5=CoordMode Pixel zuobia,6=Gui Margin, 0, 0 zuobia,7=AutoSize zuobiao,3=CoordMode Mouse zuobiao,4=CoordMode ToolTip zuobiao,5=CoordMode Pixel zuobiao,6=Gui Margin, 0, 0 zuobiao,7=AutoSize zuoj,3=LButton zuoji,3=LButton zuojia,3=LButton zuojian,3=LButton
声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。
评论(0)