5.26.2008

Copy and Paste Without Switching Windows [Lifehacker Book Contest Winner]

via Lifehacker by Gina Trapani on 3/26/08


Readers are submitting their best life hack for a chance to win an autographed copy of our new book, Upgrade Your Life. Here's our latest winner.
Reader CK uses neat automation trick when there's heavy-duty copy and pasting to be done:

I have one very simple AutoHotkey script which I use when I need to do some massive copying and pasting work, which simplifies the task into just one keystroke: Win+C.

With this script, I run Notepad (or any program to paste the content into), browse through some web sites, select text or pictures, and hit Win+C to capture the content—without leaving my browser. The script switches to the destination program (Notepad or otherwise), pastes the information, and returns me to my browser automatically. Check out the video for how it works. It's good for transferring bits of data between two programs like compiling a list of email addresses. It's also customizable—instead of entering a new line, it can move on to the next cell in the spreadsheet.

For you AutoHotkey scripters, here's the source of CK's script:

#c:: Send, {CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP} sleep, 300 Send, {CTRLDOWN}v{CTRLUP}{ENTER}{ALTDOWN}{TAB}{ALTUP} return


To try our the compiled executable yourself, download it here. To learn more about writing your own Windows programs with AutoHotkey, see Adam's feature on how to turn any action into a keyboard shortcut with AutoHotkey.

Congrats, CK! You've just earned yourself an autographed copy of Upgrade Your Life.

There's still time to win one of the last five books that are left; here's how.