b5media.com

Advertise with us

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

Slacker Manager

Appending a scratch file with ActiveWords v.2

by Bren on July 13th, 2005

I was kinda liking my file appender trick from this post but then reader Josh Fitzgerald sent me an even better version using VBS. I don’t know jack squat about VBS (vacation bible school?), but his trick is so sweet. The ultimate outcome is identical–you get text appended to a file, but his way is much better.

The trick I posted earlier will add the text, but it also opens the text editor and makes you wait for the text to be added. It’s pretty quick, but also pretty annoying. Using Josh’s version, the scratch file is appended without the text editor ever being opened. And each note is preceded by a date and time stamp. Very nice.

So now, I just invoke my ActiveWord and am presented with a text input box. I type my text, hit enter and go back to doing whatever I was doing. The note is appended to the bottom of the scratch file, with the current time and date. Easy. As the other post mentioned, I still have another ActiveWord that pulls up the scratch file for review.

Here’s how to accomplish Josh’s trick:

  1. Create a new folder on your C:\ drive called “scratch” (so you’ll now have a folder called C:\scratch)
  2. Save this file into the new folder: right click here and download
  3. Now create a new ‘Launch a program’ ActiveWord that opens this file: C:\scratch\SFS2.VBS
  4. Try it out. When you invoke your new ActiveWord, you should get a text entry box. All text gets added to a new txt file called scratch.txt which is located here: C:\scratch\scratch.txt (if you don’t already have this file in this directory, it’ll be created on the fly—makes archiving easy)
  5. You can also create another ‘Open File’ ActiveWord for this new txt file for when you want to review it.

The way I have it set up, you just follow the instructions above and you’ll be all set. If you’re comfortable with a little tweaking, you can open the VBS file in a text editor and make changes to the file names and where they’re saved.

Nice, thanks again Josh! If you’ve got questions about the script itself, you’re better off asking Josh. He can be reached at:  aphoria [at] hotmail [dot] com

POSTED IN: best of, productivity, tips and tricks, web/tech

10 opinions for Appending a scratch file with ActiveWords v.2

  • Rock
    Jul 14, 2005 at 7:47 am

    Nice tip, thanks for posting.

  • Lifehacker
    Jul 14, 2005 at 11:59 am

    Windows append to text file

    The one function of Quicksilver for Mac OS X that I would’ve given my right 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,…

  • Lifehacker
    Jul 14, 2005 at 12:00 pm

    Windows append to text file

    The one function of Quicksilver for Mac OS X that I would’ve given my right 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,…

  • Lifehacker
    Jul 14, 2005 at 12:06 pm

    Windows append to text file- finally!

    The one function of Quicksilver for Mac OS X that I would’ve given my right 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,…

  • Gina
    Jul 14, 2005 at 12:10 pm

    D’oh! Sorry about the multiple trackbacks, Bren. Great post!!!

  • Lifehacker
    Jul 14, 2005 at 12:10 pm

    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,…

  • Bleeding Edge
    Jul 14, 2005 at 11:33 pm

    At last, an append text for Windows

    Since we installed the brilliant Quicksilver on the Mac, we’ve been using it several times a day to speed up the launching of applications, play tracks with iTunes and manyother things. One of its handy little tricks is the ability…

  • Ernest Gunn
    Jul 18, 2005 at 5:17 pm

    I combined your script with Rick Companje’s PasteToFile script:
    http://www.companje.nl/Projects/PasteToFile/
    Now when the inputbox comes up, if the input is blank then the clipboard is appended to the file. Here is my edited script (paste script to texteditor, save as C:\scratch\SFS.VBS)

    Edited Script:

    ‘ NAME : Scratch File Saver
    ‘ PURPOSE : Prompt the user to enter a string of text, then save
    ‘ it to a defined “scratch” file. I wrote this to call
    ‘ from ActiveWords.
    ‘ PROGRAMMER : Joshua Fitzgerald
    ‘ DATE : 2005-07-13

    Option Explicit

    Const ForAppending = 8

    Dim text

    text = InputBox(”Type some text or leave blank for paste:”, “Scratch File Saver”)
    WriteToFile(text)


    ‘ NAME : WriteToFile
    ‘ PURPOSE : Write a string to a file.

    Sub WriteToFile(text)
    Dim fso, html
    Dim textFile
    Dim lengthOfSeparatorLine
    Dim separatorChar
    dim filename

    lengthOfSeparatorLine = 70
    separatorChar = “-”
    filename = “C:\scratch\scratch.txt”

    Set fso = CreateObject(”Scripting.FileSystemObject”)
    set html = CreateObject(”htmlfile”)

    ‘get text data from clipboard
    if text = “” then text = html.ParentWindow.ClipboardData.GetData(”text”)
    Set textFile = fso.OpenTextFile(filename, ForAppending, True)
    textFile.WriteLine Now & ” ” & String(lengthOfSeparatorLine - Len(Now), separatorChar)
    textFile.WriteLine text

    textFile.Close
    End Sub

  • GTD Wannabe
    Dec 15, 2005 at 5:14 am

    Awesome post - I fell in love with the script as soon as I tried it out, and I’m not even a fan of the big huge text file! I made a couple of tiny mods: (1) more space, (2) Instead of ActiveWords, I make use of the Windows shortcut keys permitted for desktop shortcuts. If you’re interested, you can read my latest post (http://gtdwannabe.blogspot.com/2005/12/using-vbs-to-createappend-text-file.html). In the next couple of days, I’ll be posting a simple batch file that can be used to rename the current scratch.txt to scratch_X.txt, where X is the current date and time. I thought this would be the cleanest way of archiving - who wants to manually archive? :)

    Kudos to both you and Josh for an excellent implementation!

  • GTD Wannabe
    Dec 15, 2005 at 11:09 am

    So, I’ve been using this script today and discovered something interesting (and sad). When you’re typing text in, you have a maximum of 254 characters to play with. I learned this the hard way. On the other hand, it doesn’t seem to be a problem to paste in larger pieces of text from the clipboard.