; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments. They are not executed. ; This script has a special filename and path because it is automatically
; launched when you run the program directly. Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it. You can have as many .ahk
; files as you want, located in any folder. You can also run more than
; one .ahk file simultaneously and each will get its own tray icon. ; SAMPLE HOTKEYS: Below are two sample hotkeys. The first is Win+Z and it
; launches a web site in the default browser. The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one). To
; try out these hotkeys, run AutoHotkey again, which will load this file. ;让脚本持久运行 (即直到用户关闭或遇到 ExitApp).
;#Persistent ;强制加载新的脚本
#SingleInstance force ;尝试加载图标
IfExist, icon.ico ;花括号“{”不能和 IfExist 写在同一行
{
Menu TRAY, Icon, icon.ico ;这句会把 icon.ico 作为图标
} ;定时器 输入为分钟数
#t::
; 弹出一个输入框,标题 内容
InputBox ,time,定时器,请输入一个时间(单位是分钟),,, ;InputBox, time, 计时器, 请输入一个时间(单位是分钟)
time := time** ; 变量赋值,多一个冒号,乘以 * 变time为分钟数
Sleep,%time%
MsgBox,,提示信息, 打卡啦
return /*
;打开ie浏览器
#1::
run C:\Program Files\Internet Explorer\iexplore.exe
return ;打开firefox浏览器
#2::
;run D:\Program Files\Mozilla Firefox\firefox.exe
run C:\Documents and Settings\koujincheng\Local Settings\Application Data\Google\Chrome\Application\chrome.exe
return
*/ ;打开everything
^!e::
Run D:\Program Files\everything\Everything.exe
return ;打开任务管理器
^!K::
Run taskmgr
return ;打开远程连接
^!m::
Run mstsc
return ;新建或激活记事本窗口
^!n::
IfWinExist ahk_class Notepad
WinActivate
else
Run Notepad
return ;UltraEdit32
^!u::
Run D:\Program Files\UltraEdit\Uedit32.exe
return ;截图工具 FSCapture
^!c::
Run D:\Program Files (x86)\FScapture\FSCapture.exe
return ; Foxmail
^!f::
Run D:\Program Files (x86)\Foxmail7.\Foxmail.exe
return ; P2PSearcher
^!p::
Run D:\Program Files (x86)\P2PSearchers\P2PSearcher.exe
return ;重新加载脚本
^!r::Reload ; Assign Ctrl-Alt-R as a hotkey to restart the script. ;##################################################window script#############################################################
;###################################################窗口操作################################################################# ;最大化或还原(取消最大化)窗口
~LAlt::
Keywait, LAlt, , t0.
if errorlevel =
return
else
Keywait, LAlt, d, t0.
if errorlevel =
{
WinGet, DAXIAO , MinMax, A
if (DAXIAO = "")
{
PostMessage, 0x112, 0xF120,,, A ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE
}
else
{
PostMessage, 0x112, 0xF030,,, A ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE
}
}
return ;最小化窗口 记录最后三个最小化的窗口
~RAlt::
Keywait, RAlt, , t0.
if errorlevel =
return
else
Keywait, RAlt, d, t0.
if errorlevel =
{
If (WinActive("ahk_class Progman") or WinActive("ahk_class WorkerW"))
{
}
else
{
Last_Max_Id=
WinGet, Last_Min_Id, ID, A
if (MinMemo1 = "")
MinMemo1=%Last_Min_Id%
else if(MinMemo2 = "")
{
MinMemo2=%MinMemo1%
MinMemo1=%Last_Min_Id%
}
else
{
MinMemo3=%MinMemo2%
MinMemo2=%MinMemo1%
MinMemo1=%Last_Min_Id%
}
IfWinNotActive ahk_class TXGuiFoundation
WinMinimize, A
else ;qq窗口使用ctrl+alt+z 最小化
{
WinGetTitle, Temp0 , A
If Temp0 contains QQ20
{
sleep,
Send, {CTRLDOWN}{ALTDOWN}z{ALTUP}{CTRLUP}
}
else
WinMinimize, A
}
}
} ;end if errorlevel =
return
;恢复最小化的窗口,最多三个(只能识别通过脚本最小化的窗口)
>!Space::
if (MinMemo1 = "") ;不存在通过脚本最小化的窗口
{
WinRestore, A
WinActivate,A
}
else if (MinMemo2 = "") ;只有一个
{
WinRestore, ahk_id %MinMemo1%
WinActivate, ahk_id %MinMemo1%
MinMemo1=
}
else if (MinMemo3 = "")
{
WinRestore, ahk_id %MinMemo1%
WinActivate, ahk_id %MinMemo1%
MinMemo1=%MinMemo2%
MinMemo2=
}
else
{
WinRestore, ahk_id %MinMemo1%
WinActivate, ahk_id %MinMemo1%
MinMemo1=%MinMemo2%
MinMemo2=%MinMemo3%
MinMemo3=
}
return ;关闭窗口,在浏览器中为关闭标签页
~Esc::
Keywait, Esc, , t0.
if errorlevel =
return
else
Keywait, Esc, d, t0.
if errorlevel =
{
IfWinActive ahk_class ahk_class IEFrame ;识别IE浏览器
Send {ctrldown}w{ctrlup}
else IfWinActive ahk_class MozillaWindowClass ;识别firfox 浏览器
Send {ctrldown}w{ctrlup}
else
send !{F4}
}
return ;##################################################other script#############################################################
;###################################################其它脚本################################################################ ;快速按下两次Ctrl 快速粘贴
/*
~LCtrl::
Keywait, LCtrl, , t0.5
if errorlevel = 1
return
else
Keywait, LCtrl, d, t0.3
if errorlevel = 0
{
Send,^v
}
return
*/ ;win+shift+f 在桌面上建立一个以当前日期命名的文件夹
#+f::
Click right ;在桌面当前鼠标所在位置点击鼠标右键
Send, wf ;快捷键新建文件夹
Sleep, ; 把暂停时间改小
clipboard = %A_MM%-%A_DD%-%A_YYYY% ;%A_Hour%-%A_Min%-%A_Sec%-%A_MSec%;把当前的系统日期发送到剪贴板
Send, ^v{Enter} ;发送 Ctrl + v 和回车确认修改文件夹名称
return ;ctrl+win+c 得到当前选中文件的路径,保存到剪贴板中
^#c::
send ^c
sleep,
clipboard=%clipboard% ;解释:windows复制的时候,剪贴板保存的是“路径”.只是路径而不是字符串,只要转换成字符串就可以粘贴出来了
tooltip,%clipboard% ;提示文本
sleep,
tooltip, ;置空
return ; Win+O 关闭显示器
#o::
Sleep ; 让用户有机会释放按键 (以防释放它们时再次唤醒显视器).
SendMessage, 0x112, 0xF170, ,, Program Manager ; 关闭显示器: 0x112 为 WM_SYSCOMMAND, 0xF170 为 SC_MONITORPOWER. ; 可使用 - 代替 打开显示器, 代替 激活显示器的节能模式
return ;获取当前系统日期
::ddd::
;获得系统时间比如今天的时间:--。如果需要“年”的话请替换上面的“-”。
d = %A_YYYY%-%A_MM%-%A_DD%
;把 d 的值发送到剪贴板,变量不用声明,引用变量的值时在变量的前后加“%”。clipboard是 AHK 自带的变量:剪切板
clipboard = %d%
Send ^v
return ;获取当前系统时间
::/time::
d = %A_Hour%:%A_Min%:%A_sec%
clipboard = %d%
Send ^v
return ;获取系统日期和时间
::/all::
d = %A_YYYY%-%A_MM%-%A_DD% %A_Hour%:%A_Min%:%A_sec%
clipboard = %d%
Send ^v
return ::/kou::
Send , koujincheng{Shift}{Tab}.abcdd{Enter}
return ;选中路径,快速打开
#j::
send ^c ; 复制选中的文字
clipwait ; 等待复制动作的完成
Clipboard := Trim(clipboard,A_Space) ;去除空格
Run %clipboard%
return ; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs. ; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks. It also explains more about hotkeys.

AutoHotKey 常用脚本的更多相关文章

  1. MS SQL 日常维护管理常用脚本(二)

    监控数据库运行 下面是整理.收集监控数据库运行的一些常用脚本,也是MS SQL 日常维护管理常用脚本(一)的续集,欢迎大家补充.提意见. 查看数据库登录名信息   Code Snippet SELEC ...

  2. Inno Setup的常用脚本

    Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程 ...

  3. 常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript

    常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript Javascript现阶段还不适合用来做独立开发,它的天下还是在web应用 ...

  4. shell常用脚本

    shell常用脚本 author:headsen chen  2017-10-17 15:36:17 个人原创,转载请注明,否则依法追究法律责任 1,vim  name.grep.sh 2,cat   ...

  5. Google常用脚本

    1.Tampermonkey 可下载常用脚本:https://greasyfork.org/zh-CN 2.常用FQSetupVPN 3.百度药丸屏蔽广告 4.百度文档可粘贴,下载 5.VIP视频可看

  6. 游戏编程之Unity常用脚本类的继承关系

    前言学习Unity开发引擎的初学者会接触大量的脚本类,而这些类之间的关系往往容易被忽略.本文对Unity引擎开发中的一些常用类及其关系进行了简单的归纳总结. 博文首发地址:http://tieba.b ...

  7. Linux 常用脚本

    Linux 常用脚本   修改表列属性   sql可任意修改,若数据库正好在执行机器上,可去掉ip地址 echo 为输出   #!/bin/shfor((i=0;i<256;i++));do   ...

  8. oracle 常用脚本以及语句

    oracle 常用脚本以及语句 一.oracle 安装10G 单机初始化环境: #!/bin/bash #关闭selinuxsed -i 's\SELINUX=enforcing\SELINUX=di ...

  9. PowerDesigner 设计数据库中常用脚本

    PowerDesigner 设计数据库中常用脚本 数据库设计 物理模型设置 Name转Comment脚本 '********************************************** ...

随机推荐

  1. Tomcat报错:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JFreeChartTest]]

    最好把项目移除,然后在tomcat的webapps发布路径下也把项目文件删掉,重新部署就好了,原因是可能在tomcat的remove覆盖中以前的文件有所保留导致冲突,亲测有效

  2. 在Linux系统里运行shutdown.sh命令关闭Tomcat时出现错误提示

    服务器:linnux 5.5 64位,已安装好 jdk: Tomcat版本:apache-tomcat-7.0.53 操作软件:Xshell 4(Free for Home / School) 刚开始 ...

  3. 【BZOJ1043】下落的圆盘 [计算几何]

    下落的圆盘 Time Limit: 10 Sec  Memory Limit: 162 MB[Submit][Status][Discuss] Description 有n个圆盘从天而降,后面落下的可 ...

  4. hdu5909 Tree Cutting

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=5909 [题解] 设$f_{x,i}$表示以$x$节点的子树中,权值为$i$的子树个数,其中$x$必选. ...

  5. 【vijos】P1659 河蟹王国

    [算法]线段树 [题解]区间加上同一个数+区间查询最大值.注意和谐值可以是负数,初始化ans为负无穷大. #include<cstdio> #include<algorithm> ...

  6. Chinese Rings (九连环+矩阵快速幂)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2842 题目: Problem Description Dumbear likes to play th ...

  7. 4 Values whose Sum is 0 POJ 2785 (折半枚举)

    题目链接 Description The SUM problem can be formulated as follows: given four lists A, B, C, D of intege ...

  8. End to End Sequence Labeling via Bidirectional LSTM-CNNs-CRF论文小结

    本篇论文是卡内基梅隆大学语言技术研究所2016年  arXiv:1603.01354v5 [cs.LG] 29 May 2016 今天先理解一下这个是什么意思:        找到的相关理解:arXi ...

  9. 动归专题QAQ(两天创造的刷题记录哟!✿✿ヽ(°▽°)ノ✿✿)(未填坑)

    1092 采药:由于没有限制开始时间和结束时间,01背包就好了 1095 开心的金明:01背包,无fuck说 1104 摆花:f[i][j]表示摆了i种花,第i种花摆了j种的方案数,乱转移0.0(感觉 ...

  10. linux下进行base64编码解码

    1.编码 2.解码