Build. Hack. Play. It's just what we do.
Build. Hack. Play. It's just what we do.

Open, Edit, and Close a File With a Single Key Combo

Here is an AutoHotkey script to open a specific file for editing, then close it with the same combo.

 #numpad9:: ; toggle dictionary list on and off.
keywait, #numpad9
if toggle := !toggle
Run, “C:\box\docs\ReadPlease-words.txt”
Send ^s
send, !{F4}

^^ This AHK script has been proving its worth for about two years. I use it to maintain a list of word pronunciations for my text-to-speech software. You can use it for whatever file gets constant edits. In this instance, we’re using the Windows key plus the number 9 on the numeric key pad to open the file, make changes, then close the file. There is no confirmation dialog to hold things up; ctrl+s will do the saving just before alt+F4 does the closing. Hope you like.

Share This Story

Get our newsletter