http://www.autohotkey.com/
AutoHotkey is a free, open-source utility for Windows. With it, you can:
- Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
- Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
- Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".
- Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.
- Remap keys and buttons on your keyboard, joystick, and mouse.
- Respond to signals from hand-held remote controls via the WinLIRC client script.
- Run existing AutoIt v2 scripts and enhance them with new capabilities.
- Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.
Getting started might be easier than you think. Check out the quick-start tutorial.
下面的脚本可以在ctrl+alt+n时,拷贝当前选中文本,然后启动记事本。。方法是先发ctrl-C,实现拷贝文本到剪贴板,然后启动自己的程序。(里面的粘贴部分不起作用,以后再研究。。。)
^!n::
send, ^c
IfWinExist Untitled - Notepad
{ WinActivate
Send, ^v
}
else
{ Run Notepad
WinActivate
Send, ^v
}
return