Appending a scratch file with ActiveWords
I don’t know about you, but I make liberal use of text files for storing random pieces of stuff for processing later. When I’m on the web, I just use the clipper function in EverNote, but when I’m offline and something pops into my head, I like to record it somewhere. That somewhere is usually a “scratch” file, which is just a simple txt file that I edit with CrimsonEditor.
The other day, while trolling the ActiveWords forums, I ran across a request, and subsequent solutions that caught my eye. A poster wanted to know how to use AW to quickly append to a text file, save and exit. That sounded pretty useful to me, too. So I started messing around with one of the solutions and came up with something that works well for me. Figured it might be useful for other folks too, so here’s the deal…
First thing you gotta do is create the file you’ll be appending to. Let’s call it “scratch.txt” and let’s let it live on the XP desktop. Now you’ve got to create an activeword called “scratch” which opens that file. With me so far?
Now you create a new activeword—I called mine “edt.” When invoked, this one will bring up a small single-entry dialog box asking for the text you want appended. You’ll enter the text, hit “Enter” and the “scratch.txt” file will be opened, the text will be appended to the bottom of the list, the file will be saved and closed, and you’ll be returned to the application you started from. Here’s the code to do all that:
<word:scratch><wait for window:title=Crimson Editor><ctrl><end></ctrl><inputbox:"
Enter text for scratch file:":Append to Scratch File><Enter:1><ctrl>s</ctrl><ctrl><F4></ctrl><PREVIOUS WINDOW>
You’ll need to adjust the values that are in red to suit your own setup, but this’ll get you way down the road. Now whenever a random thought hits you while you’re working and you don’t want to lose it, you can just type your activeword, enter your text and move on with an empty head.
Related Stories
POSTED IN: best of, tips and tricks