;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的更多相关文章

随机推荐

  1. Java 在PDF中添加水印

    在日常工作和学习中,PDF的普及给人们带来了极大的便利,但同时也出现了很多问题. PDF文件容易复制和传播,版权难以保护. 在海量文件中也很难区分信息,例如,你有没有打开一个文件夹,里面有这么多同名的 ...

  2. 【java】学习路径26-泛型,集合使用自定义的类型

    接着上一节的内容,上一节我们使用到了ArrayList.Vector.LinkedList三个集合类型. 但是目前我们有一个问题:如果集合中存储的是Integer类型的数据(int的引用类型),那我们 ...

  3. 【java】基础1-字符串、堆、栈、静态与引用类型

    /*结论:1,一般变量(int,float,boolean..)使用==比较,引用类型(String,int[],对象)使用equals比较.2,一般的变量存放在栈中,new出来的对象都存放在堆中,字 ...

  4. Helm安装ingress-nginx-4.2.3

    Application version 1.3.0 Chart version 4.2.3 获取chart包 helm fetch ingress-nginx/ingress-nginx --vers ...

  5. KingbaseES V8R3集群管理和维护案例之---failover切换wal日志变化分析

    ​ 案例说明: 本案例通过对KingbaseES V8R3集群failover切换过程进行观察,分析了主备库切换后wal日志的变化,对应用者了解KingbaseES V8R3(R6) failover ...

  6. Mac根据端口找进程id

    lsof -i:20942 以后认真的学习一下这个命令

  7. 操作服务器的神奇工具Tmux

    Tmux 是什么? 会话与进程 命令行的典型使用方式是,打开一个终端窗口(terminal window,以下简称"窗口"),在里面输入命令.用户与计算机的这种临时的交互,称为一次 ...

  8. 选择排序C语言版本

    算法思路,从头至尾扫描序列. 首先从第二个到最后,找出最小的一个元素,和第一个元素交换: 接着从第三个到最后,后面找出最小的一个元素,和第二个元素交换: 依次类推最终得到一个有序序列. void Se ...

  9. 5.第四篇 Etcd存储组件高可用部署

    文章转载自:https://mp.weixin.qq.com/s?__biz=MzI1MDgwNzQ1MQ==&mid=2247483792&idx=1&sn=b991443c ...

  10. Pixar 故事公式

    文章转载自:https://mp.weixin.qq.com/s/wMfFVh9tAM5Qo4ED658yUg