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脚本 '********************************************** ...
随机推荐
- UVA 11105 Semi-prime H-numbers
https://vjudge.net/problem/UVA-11105 筛法 #include<cstdio> #include<cstring> #define N 100 ...
- Codeforces 713C Sonya and Problem Wihtout a Legend DP
C. Sonya and Problem Wihtout a Legend time limit per test 5 seconds memory limit per test 256 megaby ...
- Codeforces Round #380 (Div. 2)/729E Subordinates 贪心
There are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a ...
- [Luogu 2580] 于是他错误的点名开始了
[Luogu 2580] 于是他错误的点名开始了 不用好奇我为什么突然发水题题解- 突然觉得自己当年的幼儿园码风太幼稚,就试图把数据结构什么的用指针重写一遍- 想当年因为空间开太大而全 RE,调了一下 ...
- mysql 数据库备份与还原,用户的创建与删除,用户的密码修改
1.备份数据库 要退出mysql rimideiMac-23:~ rimi$ mysqldump -u root -p pro >pro.sql ls 查看路径 2.恢复数据库 2.1直接 ...
- 【lydsy1407】拓展欧几里得求解不定方程+同余方程
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1407 题意: 有n个野人,野人各自住在第c[i]个山洞中(山洞成环状),每年向前走p[i] ...
- Codeforces Round #302 解题报告
感觉今天早上虽然没有睡醒但是效率还是挺高的... Pas和C++换着写... 544A. Set of Strings You are given a string q. A sequence o ...
- 12.24笔记(关于//UIDynamic演练//多对象的附加行为//UIDynamic简单演练//UIDynamic//(CoreText框架)NSAttributedString)
12.24笔记1.UIDynamic注意点:演示代码:上面中设置视图旋转的时候,需要注意设置M_PI_4时,视图两边保持平衡状态,达不到仿真效果.需要偏移下角度.2.吸附行为3.推动行为初 ...
- word-wrap word-break 区别
word-wrap word-break 区别 word-break * word-break:break-all;//直接把单词截断 * word-break:break-word;//虽然单词截断 ...
- python中的binascii模块
binascii模块拿来干嘛的? 答:进制转换xxoo #!/usr/bin/env python # encoding:utf-8 # by i3ekr import binascii s = &q ...