b5media.com

Advertise with us

Enjoying this blog? Check out the rest of the Business Channel Subscribe to this Feed

Slacker Manager

Append to scratch file v.3

by Bren on July 18th, 2005

Yet another fantastic revision to the scratch file append trick. This time Ernest dropped some new code in the comments which slightly changed the vbs script so that when you’re presented with the ‘enter text’ box, you can leave it blank and hit enter and whatever text is on your clipboard will get appended to the file. Excellent! Ernest, you rock!

Since the new version doesn’t mess with any of the old features, I’ve just overwritten it. You can still grab the file here. You can see the previous instructions here, or additional instructions over at Lifehacker.

One last little trick with this script. I mentioned you can use it with ActiveWords and that’s how I do it. Lifehacker mentioned using some funky Windows system path editing to accomplish the same result. There is also a freeware utility called AutoHotKey that does something similar to ActiveWords, though without the friendly interface. I’ve made things easy on you. Go download AutoHotKey and install it. Then save this script somewhere on your machine. With AutoHotKey running, double click the script. It’ll add a green ‘H’ icon in your tray. Now, assuming you’ve saved your vbs script in the ‘C:\scratch’ directory (if you’ve got it somewhere else, just right click the green ‘H’ icon and click ‘Edit This Script’ and change the path, then exit and restart the script)  you can just hold down the Windows key and hit the / key (right above it) and you’ll immediately invoke the scratch file entry text box. For me, this trick is a two keystroke savings over the ActiveWords method. For Lifehacker, the savings are even better–and it’s still free!

POSTED IN: best of, tips and tricks

6 opinions for Append to scratch file v.3

  • Lifehacker
    Jul 20, 2005 at 7:59 am

    Windows append to text file- finally!

    The one function of Quicksilver for Mac OS X that I would’ve given my left arm for in Windows is the ability to append to a file without opening or closing a text editor quickly and simply. Now that’s possible,…

  • Samwyse
    Jul 20, 2005 at 6:04 pm

    Thanks for the pointer to AutoHotKey. I was just reading about it, and realized that you could replace the entire VBS script with a fairly simple AHK macro. In addition, you can compile the macro into a .EXE file and not have to distribute AHK to people (assuming that you can get them to trust the .EXE, that is)… OK, ten minutes later, I have a macro:

    ; set Windows-C to append to a scratch file
    ; enter text in the input box, or hit cancel to
    ; append whatevers in the clipboard
    #c::
    ScratchFile = C:\temp\scratch.txt
    FormatTime, OutputVar
    FileAppend, %OutputVar%`n, %ScratchFile%
    InputBox, OutputVar, Scratch, Enter some text to append
    if ErrorLevel
    OutputVar = %clipboard%
    FileAppend, %OutputVar%`n`n, %ScratchFile%
    return

  • Sergiy Korobkov
    Jul 21, 2005 at 12:05 pm

    Speaking of ActiveWords. I recently discovered AppRocket (http://candylabs.com/approcket/) and it made me forget about AW. Just combine it with AutoHotKey scripts and voila! Quicksilver for Win :)

  • Kristoph Minchau
    Dec 19, 2005 at 3:01 pm

    I also changed the script into an AutoHotKey (AHK) macro, but improved the formatting of the “quote”, and in addition to having a date, it also copies the current website address and adds it to the top, so that you know where the quote came from. A sample quote:

    -
    [1:59 PM 12/19/2005]
    -
    **From:http://www.quotationspage.com/quotes/Douglas_Adams

    Ah, this is obviously some strange usage of the word ’safe’ that I wasn’t previously aware of.

    Douglas Adams, Arthur Dent in “The Hitchhikers Guide to the Galaxy”

    And here is the well documented source:

    ;—-
    ;Add quotes to file from browser,
    ; including hyperlink and date stamp
    ;—-
    ^+c::
    ;Copy the selected text
    Send, ^c
    ;Store the quote text from the keyboard
    QuoteText = %clipboard%
    ;Select the text in the address bar
    ;Internet Explorer and FireFox
    Send, !d
    ;Opera 8 (uncomment, and re-comment above to make it work
    ;Send, ^l
    ;Copy the address text
    Send, ^c
    ;Escape out of it so focus doesn’t change for user
    Send, {Esc}
    ;Create the text to append to the file
    FormatTime, TimeString,, [h:mm tt M/d/yyyy]
    TextToAppend = -`r`n
    TextToAppend = %TextToAppend%%TimeString%`r`n
    TextToAppend = %TextToAppend%-`r`n
    TextToAppend = %TextToAppend%**From:%clipboard%`r`n
    TextToAppend = %TextToAppend%—`r`n
    TextToAppend = %TextToAppend%%QuoteText%`r`n
    TextToAppend = %TextToAppend%—`r`n`r`n`r`n
    ;Append the text to the file
    FileAppend, %TextToAppend%, %A_MyDocuments%/Quotes.txt
    ;Beep to let user know that something happend
    SoundBeep
    return

  • Bren
    Dec 19, 2005 at 3:15 pm

    Very nice, thanks Kristoph!

  • Lifehacker
    Dec 28, 2005 at 9:19 am

    Windows append to text file- finally!

    The one function of Quicksilver for Mac OS X that I would’ve given my left arm for in Windows is the ability to append to a file without opening or closing a text editor quickly and simply. Now that’s possible,…