高效工具:AutoHotKey

ahk是热键脚本文件扩展名的一种,编写ahk文件使用的脚本语言是autohotkey。autohotkey通过把常用的键盘鼠标操作编写成脚本语句来动态调用的方式避免了每次手动输入的重复操作,提高了使用计算机的工作效率。


;Author: 

;date: 2015-11-20 10:08:56

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SetTitleMatchMode 2

Activate(t)

{

IfWinActive,%t%

{

WinMinimize

return

}

SetTitleMatchMode 2

DetectHiddenWindows,on

IfWinExist,%t%

{

WinShow

WinActivate

return 1

}

return 0

}

ActivateAndOpen(t,p)

{

if Activate(t)==0

{

Run %p%

WinActivate

return

}

}

; win+o启动outlook邮箱

#o::ActivateAndOpen("Microsoft Outlook","outlook.exe")

#1::Activate("Microsoft Outlook")

#f::ActivateAndOpen("Foxit Reader","C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe")

#2::Activate("Foxit Reader")

#c::ActivateAndOpen("Google Chrome","C:\Program Files\Google\Chrome\Application\chrome.exe")

#3::Activate("Google Chrome")

#s::ActivateAndOpen("Xshell","D:\software-installpackage\xshell_xftp\Xshell_4.0.0128_Xftp_4.0.0110_PortableSoft\XshellXftpPortable\XshellPortable.exe")

#4::Activate("Xshell")

#w::ActivateAndOpen("notes","C:\Program Files\Notes\notes.exe")

#5::Activate("notes")

; win+p 启动记事本

#p::ActivateAndOpen("Notepad++","Notepad++.exe")

#6::Activate("Notepad++")

#q::ActivateAndOpen("nyfedit","D:\software-installpackage\myBase_Desktop_6.20\nyfedit.exe")

#7::Activate("nyfedit")

;win+j 启动金山词霸

#j::ActivateAndOpen("XDict","C:\Program Files\Kingsoft\PowerWord_cut\XDict.exe")

#8::Activate("XDict")

#x::ActivateAndOpen("XMind","D:\software\XMind\XMind.exe")

#9::Activate("XMind")

;#e::ActivateAndOpen("eclipse.exe","D:\eclipse\eclipse.exe")

;#-::Activate("eclipse.exe")

; win+g 启动google浏览器

;#g::Run "C:\Program Files\Google\Chrome\Application\chrome.exe"

;#b::Run www.baidu.com

;#g::Run www.google.com.hk

;win+方向键左箭头;;表示窗口向左放置

;win+方向键右箭头;;表示窗口向右放置

;win+方向键上箭头;;表示窗口最大化

;win+方向键下箭头;;表示窗口窗口化;再次win+方向下箭头;;表示窗口最小化

WinStatus:=0

;ctrl+m 最大化、窗口化当前窗口

;^m::

;

;if WinStatus=0

;

;{

;

;    WinMaximize , A

;

;    WinStatus:=1

;

;}

;

;else

;

;{

;

;    WinRestore ,A

;

;    WinStatus:=0

;

;}

;

;return

;输入/dd

;然后摁enter 表示输入时间

::/dd::

d = %A_YYYY%-%A_MM%-%A_DD% %A_Hour%:%A_Min%:%A_Sec%

clipboard = %d%

Send ^v

return

::/ss::

d = %A_YYYY%-%A_MM%-%A_DD% %A_DDDD%

clipboard = %d%

Send ^v

return

::/zqh::郑泉海

;win +鼠标中键 关闭窗口

#MButton::

SendInput !{F4}

Return

; 选取文本后按〔win+G〕执行 Google 搜寻

#g::

current_clipboard = %Clipboard% ; 把目前的剪贴板内容存起来供后面还原

Clipboard = ; 先把剪贴板清空

Send ^c

; 把选取字串用〔Ctrl+C〕存入剪贴板

ClipWait, 1 ; 等待 1 秒让剪贴板执行存入动作

; 下行使用 Google 执行搜寻动作,要搜寻的字串就是剪贴板内容

Run http://www.google.com.hk/search?hl=zh-TW&q=%Clipboard%

Clipboard = %current_clipboard% ; 还原先前的剪贴板内容

return

; 选取文本后按〔Win+b〕执行 baidu 搜寻

#b::

current_clipboard = %Clipboard% ; 把目前的剪贴板内容存起来供后面还原

Clipboard = ; 先把剪贴板清空

Send ^c

; 把选取字串用〔Ctrl+C〕存入剪贴板

ClipWait, 1 ; 等待 1 秒让剪贴板执行存入动作

; 下行使用 Google 执行搜寻动作,要搜寻的字串就是剪贴板内容

Run https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=0&rsv_idx=1&tn=baidu&wd=%Clipboard%

Clipboard = %current_clipboard% ; 还原先前的剪贴板内容

return

;#1::

;run, http://mail.163.com

;WinWaitActive, 网易 ;;等待网页加载成功(至少title显示出来)

;sleep, 1000 ;;保险起见,再等1秒(视网速而定)

;send, user-id{tab}password{enter};;模拟键入用户名、密码、回车

;return

;按F9键停止所有热键

F9::suspend

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Tutorial and Overview This brief introduction will help y...
    Felixology阅读 4,809评论 0 1
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,280评论 19 139
  • 在日常的工作中有很多东西其实是在重复性操作。懒人就想出了许多懒办法来提高效率。除了学习自己编程之外,其他有些东西还...
    鹿角海棠阅读 5,242评论 2 2
  • “老板,来份面条,一个肉夹馍不放辣椒啊,一定不放辣椒啊吃不了辣。”这是今儿中午在单位旁不远的小店我点的午饭。没成想...
    某酒馆阅读 4,406评论 1 1
  • 聊聊TTT 随着移动互联网深入的发展和对人们无时无刻的影响,培训行业的多样性和形式也出现了多种。国家下发的红头文件...
    林奎阅读 4,985评论 0 2

友情链接更多精彩内容