ahk_more
;20:47 2022/5/8
#NoEnv
#Warn
#SingleInstance Force
;设工作目录为桌面
SetWorkingDir %A_Desktop%
;托盘提示必须放在热键前面,巨坑
Menu, Tray, Tip , 出品`n版本:0.22`n2022/5/8
;
Var =
(
Alt+1 窗口置顶,再按取消
Shift+S 选词搜索
Shift+p 获取文件全路径
Shift+q 打开 常用网址
win+n 打开记事本
Win+[ 〔2022〕
Win+j 今天日期
Win+y 2022-05-22
Shift+F1 当前网址生成快捷方式到桌面
Win+v 剪贴板里富文本转纯文本
鼠标左 Ctrl+z 恢复
鼠标右 F5(刷新)
鼠标上 最大化窗口 win+up
鼠标下 显示桌面 win+d
鼠标左下 撤销关闭的浏览器标签页Ctrl+Shift+T
鼠标右下 关闭标签页Ctrl+w
鼠标右上 关闭窗口Alt+F4
鼠标左上 弹出信息框提示用法
ctrl+alt+u 打开用户、系统启动文件夹
by 05/08/2022
)
;
Menu, Tray, Add ; 创建分隔线.
Menu, Tray, Add, 操作说明, MenuHandler ; 创建新菜单项.
return
;
MenuHandler:
MsgBox %Var%
return
;功能:按win+n打开记事本
;
#n::
Run, Notepad.exe
Winactivate, 无标题 - 记事本
WinWaitActive, 无标题 - 记事本
Send, {F5}{enter}
Return
;
;功能:打开用户、系统启动文件夹
;按CTRL+ALT+u 启用
;
^!u::
run,shell:Common Startup
run,shell:startup
return
;
;
;功能:活动窗口按Alt+1置顶,再按一次可以取消置顶
;
!1::
WinSet,AlwaysOnTop, , A
return
;
;
; Shift+S 选词搜索
; 百度链接可能需要经常修改
+s::
Send,^c
Sleep 100
Run,https://www.baidu.com/s?ie=UTF-8&wd=%clipboard%
return
;
;
;Shift+p 获取全路径
;
+p::
; null=
send ^c
sleep,200
clipboard=%clipboard% ;%null%
tooltip,%clipboard%
sleep,500
tooltip,
msgbox,%clipboard%
return
;
;
;Shift+q,打开 常用网址
;
+q::
run,http://www.baidu.com
return
;
;
;以下用于文本快捷输入,共6个功能
;
;Win键+ [ ,输入〔2022〕
#[::
send 〔2022〕
return
;
;
;Win+j ,输入 今天的日期
#j::
FormatTime, today, , yyyy年M月d日
send %today%
return
;
;Win+x,输入 什么什么
#x::
send 什么什么
return
;
;Win+y,输入 2021-10-1式样日期
#y::
FormatTime, today, , yyyy-MM-dd
send %today%
return
;
;
;将当前网址生成快捷方式到桌面
;Shift+F1触发
+F1::
;复制链接
Send,^c
;延时0.1秒
Sleep 100
;获得当前活动窗口的标题放入变量%Title%"
WinGetTitle, Title, A
;=======原来的代码供参考=========
;MsgBox, The active window is "%Title%".
;IniWrite, %clipboard%, %A_Desktop%\Web请重命名.url, InternetShortcut, URL
;=======原来的代码结束段=========
; 移除%Title%变量中不能作为文件名的字符:
;主要包括 \ / : * ? " < > |
Loop
{
StringReplace, Title, Title, \, , UseErrorLevel
StringReplace, Title, Title, /, , UseErrorLevel
StringReplace, Title, Title, :, , UseErrorLevel
StringReplace, Title, Title, *, , UseErrorLevel
StringReplace, Title, Title, ?, , UseErrorLevel
StringReplace, Title, Title, "", , UseErrorLevel
StringReplace, Title, Title, <, , UseErrorLevel
StringReplace, Title, Title, >, , UseErrorLevel
StringReplace, Title, Title, |, , UseErrorLevel
if (ErrorLevel = 0) ; 不需要再进行替换.
break
}
;写快捷方式到桌面
IniWrite, %clipboard%, %A_Desktop%\%Title%.url, InternetShortcut, URL
msgbox, 快捷方式已生成
return
;
;全局鼠标手势
;转载自 https://blog.csdn.net/formyself/article/details/43487409
;实现原理:识别右键按下时的鼠标位置,以及抬起鼠标右键时的位置。
;当X(水平)、Y(垂直)方向大于一定像素阈值(这里设定为30)时,判断在此方向上有移动。
;当X、Y方向都小于此阈值时,判断没有移动,发出默认的『鼠标右键』。
;
rbutton::
minGap = 30 ; 设定的识别阈值,大于此阈值,说明在某方向上有移动
mousegetpos xpos1,ypos1
Keywait, RButton, U
mousegetpos xpos2, ypos2
if (abs(xpos1-xpos2) < minGap and abs(ypos1-ypos2)<minGap) ; nothing 没有运动,直接输出rbutton
send, {rbutton}
else if (xpos1-xpos2 > minGap and abs(ypos1-ypos2)<minGap) ; 左 Ctrl+z 恢复
send, ^z
else if (xpos2-xpos1 > minGap and abs(ypos1-ypos2)<minGap) ; 右 F5(刷新)
send, {F5}
else if (abs(xpos1-xpos2)< minGap and (ypos1-ypos2)>minGap) ; 上 最大化窗口, win+up
send, #{up}
else if (abs(xpos1-xpos2)< minGap and (ypos2-ypos1)>minGap) ; 下 显示桌面, win+d
send, #d
else if (ypos2-ypos1 > minGap and (xpos1-xpos2) > minGap) ; 左下 Ctrl+Shift+T 撤销关闭的标签页
send, ^+t
else if (ypos2-ypos1 > minGap and (xpos2-xpos1) > minGap) ; 右下 Ctrl+w 关闭标签页
send, ^w
else if (ypos1-ypos2 > minGap and (xpos2-xpos1) > minGap) ; 右上 Alt+F4 关闭窗口
send, !{F4}
else if (ypos1-ypos2 > minGap and (xpos1-xpos2) > minGap) ; 左上 弹出帮助说明信息框
;send, {rbutton} ;左上 nothing
MsgBox %Var%
else
send, {rbutton}
return
;
;
;来自B站 富文本转纯文本
;先复制要处理的文本,后按Win+v键即可
;
#v::
loop
{
StringReplace,Clipboard,Clipboard,【,〔,UseErrorLevel ;左六角
StringReplace,Clipboard,Clipboard,[,〔,UseErrorLevel ;左六角
StringReplace,Clipboard,Clipboard,】,〕,UseErrorLevel ;右六角
StringReplace,Clipboard,Clipboard,],〕,UseErrorLevel ;右六角
StringReplace,Clipboard,Clipboard,:,:,UseErrorLevel ;冒号
StringReplace,Clipboard,Clipboard,?,?,UseErrorLevel ;问号
StringReplace,Clipboard,Clipboard,!,!,,UseErrorLevel ;叹号
StringReplace,Clipboard,Clipboard,(,(,,UseErrorLevel ;左括号
StringReplace,Clipboard,Clipboard,),),,UseErrorLevel ;右括号
StringReplace,Clipboard,Clipboard,`,, ,,UseErrorLevel ;逗号
StringReplace,Clipboard,Clipboard,` ,,UseErrorLevel ;空格
StringReplace,Clipboard,Clipboard,`;,;,UseErrorLevel ;分号
StringReplace,Clipboard,Clipboard,`.,。,UseErrorLevel ;句号
if ErrorLevel = 0 ;没有则不替换
break
}
Clipboard := Clipboard
Send ^v
return
;
;GUI界面功能暂时取消
;GUI界面功能暂时取消
/*
;
;Gui界面快捷打开目录
!RButton:: ;Alt+鼠标右键触发
{
xx := (A_ScreenWidth/2) + 40
Gui Font, s14, 黑体 ; 设置 14 点大小的 黑体 字体.
Gui Add, Button, x7 y7 w158 h58, 目录
Gui Add, Button, x172 y403 w158 h58, 退出脚本
Gui Show, w335 h470 yCenter x%xx%, 快捷打开-2022/03/06
WinSet, AlwaysOnTop ,on,快捷打开-2022/03/06 ;让这个窗口在顶
Return
}
GuiEscape:
GuiClose:
Gui, Hide
Return
Button目录:
Gui, Submit
Gui, Hide
run,H:\年
Button退出脚本:
Gui, Destroy ;销毁窗口
ExitApp ;退出程序
;
; End of the GUI section
;=============
;GUI界面功能暂时取消
;GUI界面功能暂时取消
*/
;
;功能:用于Typora,以按ESC代替按CTRL+/;已取消
;
Escape::
if WinExist("ahk_class Chrome_WidgetWin_1")
Send ^/ ; 取消菜单而不激活选择的窗口.
return
;
ahk_more的更多相关文章
随机推荐
- spring项目中starter包的原理,以及自定义starter包的使用
MAVEN项目中starter的原理 一.原始方式 我们最早配置spring应用的时候,必须要经历的步骤:1.pom文件中引入相关的jar包,包括spring,redis,jdbc等等 2.通过pro ...
- 【读书笔记】C#高级编程 第十三章 异步编程
(一)异步编程的重要性 使用异步编程,方法调用是在后台运行(通常在线程或任务的帮助下),并不会阻塞调用线程.有3中不同的异步编程模式:异步模式.基于事件的异步模式和新增加的基于任务的异步模式(TAP, ...
- python自动化测试系列教程
随着互联网产品更新迭代加快,Web 开发和测试的需求也越来越大.很难想象,如果阿里的双 11.京东的 618,这些庞大繁杂的系统,由工程师们一个个手动测试,将会是一个怎样费时费力.成本巨大的工程. 也 ...
- 使用Watchtower实现Docker容器自动更新
前言:通常情况下我们手动更新容器的步骤比较繁琐,需要四个步骤: 1.停止容器 2.删除容器 3.检查镜像更新情况,更新镜像 4.重新启动容器 容器少还无所谓,但要是需要更新大量的容器就会工作量巨大. ...
- UEC++ 多线程(一) FRunnable
虚幻官方文档:https://docs.unrealengine.com/5.0/en-US/API/Runtime/Core/HAL/FRunnable/ FRunnable "runna ...
- MySQL 自增字段取值
1 前言 本文来自回答思否网友的一个问题,这个网友新建了一张表,auto_increment_increment设为10,AUTO_INCREMENT主键起始值设为9, 当他插入数据的时候,发现主键值 ...
- 开启tcp_timestamps和tcp_tw_recycle造成NAT转发连接不上
文章转载自:https://segmentfault.com/a/1190000022264813
- Redis的web管理界面redis-manager
下载 下载地址:https://github.com/ngbdf/redis-manager/releases 配置 tar -zxv -f redis-manager-2.3.2.2-RELEASE ...
- 单台主机MySQL多实例部署
二进制安装mysql-5.7.26 [root@mysql ~]# cd /server/tools/ [root@mysql tools]# ll total 629756 -rw-r--r-- 1 ...
- 使用gitlab+jenkins+nexus拉取springcloud并根据不同模块构建docker镜像,并推送到nexus里的docker仓库
1.安装gitlab 详情看:https://www.cnblogs.com/sanduzxcvbnm/p/13023373.html 安装好gitlab后,然后创建一个普通用户,编辑用户,给用户设置 ...