Sunday, June 8, 2008

一石二鳥

[ORIGINAL POST]

Current mood:accomplished

一石二鳥 (いっせき にちょう), isseki nichou
(n) killing two birds with one stone

As most people know, my computer (or at least my hard drives) blew up, so now I'm on Vista with none of my old files. But I'll write about that later.

In Vista, when you select a file and hit F2 to rename, the file extension will not be highlighted. This is good news for most people, but since I use VirtualDub a lot, I need to be able to open files quickly, and that means selecting and copying the entire file name, with the extension.

After wracking my brain trying to come up with a solution, it was good old AutoHotkey to the rescue. With this hilariously simple script, I was able to quickly and safely remap my always-useless F1 key to instantly send the sequence Ctrl+Home, Shift+Ctrl+End, enabling me to rename and highlight like I used to with just a roll of my fingers:


CommentFlag @
@Changes commentflag from ; since caffeine uses that to move right in PC Tetris games.

F1::
send ^{Home}+^{End}
return
@Highlights everything - handy for highlighting full file names.

I barely know how to write scripts for AutoHotkey (heck, I just modified this script), but I'm glad I was able to think of this workaround. It sorta makes up for that lousy Thursday at that temp agency (please, no follow-up questions)...

-

EDIT: I've since modified this script to include "Ctrl+C" by tacking on ^c to the end.