AutoHotKey 常用脚本
; 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 常用脚本的更多相关文章
- MS SQL 日常维护管理常用脚本(二)
监控数据库运行 下面是整理.收集监控数据库运行的一些常用脚本,也是MS SQL 日常维护管理常用脚本(一)的续集,欢迎大家补充.提意见. 查看数据库登录名信息 Code Snippet SELEC ...
- Inno Setup的常用脚本
Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程 ...
- 常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript
常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript Javascript现阶段还不适合用来做独立开发,它的天下还是在web应用 ...
- shell常用脚本
shell常用脚本 author:headsen chen 2017-10-17 15:36:17 个人原创,转载请注明,否则依法追究法律责任 1,vim name.grep.sh 2,cat ...
- Google常用脚本
1.Tampermonkey 可下载常用脚本:https://greasyfork.org/zh-CN 2.常用FQSetupVPN 3.百度药丸屏蔽广告 4.百度文档可粘贴,下载 5.VIP视频可看
- 游戏编程之Unity常用脚本类的继承关系
前言学习Unity开发引擎的初学者会接触大量的脚本类,而这些类之间的关系往往容易被忽略.本文对Unity引擎开发中的一些常用类及其关系进行了简单的归纳总结. 博文首发地址:http://tieba.b ...
- Linux 常用脚本
Linux 常用脚本 修改表列属性 sql可任意修改,若数据库正好在执行机器上,可去掉ip地址 echo 为输出 #!/bin/shfor((i=0;i<256;i++));do ...
- oracle 常用脚本以及语句
oracle 常用脚本以及语句 一.oracle 安装10G 单机初始化环境: #!/bin/bash #关闭selinuxsed -i 's\SELINUX=enforcing\SELINUX=di ...
- PowerDesigner 设计数据库中常用脚本
PowerDesigner 设计数据库中常用脚本 数据库设计 物理模型设置 Name转Comment脚本 '********************************************** ...
随机推荐
- 洛谷 3029 [USACO11NOV]牛的阵容Cow Lineup
https://www.luogu.org/problem/show?pid=3029 题目描述 Farmer John has hired a professional photographer t ...
- PHP系统编程--03.PHP进程信号处理
PHP的pcntl扩展提供了信号处理的功能,利用它可以让PHP来接管信号的处理,在开发服务器端守护进程方面,信号处理至关重要. 函数原型 bool pcntl_signal(int $signo ,c ...
- Maven搭建SpringMVC + SpringJDBC项目详解
前言 上一次复习搭建了SpringMVC+Mybatis,这次搭建一下SpringMVC,采用的是SpringJDBC,没有采用任何其他的ORM框架,SpringMVC提供了一整套的WEB框架,所以如 ...
- 【NOIP】提高组2015 运输计划
[题意]n个点的树,m条链,求将一条边的权值置为0使得最大链长最小. [算法]二分+树上差分 [题解] 最大值最小化问题,先考虑二分最大链长. 对所有链长>mid的链整体+1(树上差分). 然后 ...
- canvas利用formdata上传到服务器
1.首先绘制canvas图片 <canvas id="myCanvas" width="100" height="100" style ...
- vue清空input file
input file是只读的,给form一个id,用form.reset()干掉里面input的值 document.getElementById("uploadForm")&am ...
- poj 2104 可持久化线段树
我们先离散化,然后根据权值建立线段树,假设我们现在有一颗权值线段树,表示在区间1-n中每个数出现了几次,那么我们可以二分的求出来这个区间的k大值,类似sbt的select操作,那么因为点的权值插入是无 ...
- mysql中的时间year/date/time/datetime
year: mysql> create table y(y year); Query OK, 0 rows affected (0.03 sec) mysql> desc y; +---- ...
- MySQL当中的case when then
其实就相当于if else:而且也可以用if来替代. case whent 条件1 then 条件2 else 条件3 end; 如果条件1成立就执行条件2否则执行条件3 mysql ) end; + ...
- Laravel 项目上线的一些注意事项
1.应用生产环境 在 .env 文件里设置 APP_ENV=production 2.关闭调试模式 在 .env 文件中设置 APP_DEBUG = false 3.生成 APP_KEY 使用 Art ...