HackMake

Daily Scratchpad Script Hack

I’ve been on a hunt for a reliable way to collect notes throughout the work day. I need a place that I can brain dump and use as an inbox. I use index cards a lot and like them, but they are not searchable or archivable. Text files are great for that but they can be a pain to manage. I like BBEdit’s use of scratchpads in projects and wanted to mold that into a system that’s easy to initiate, manage, and comes along with the benefits of flat text files.

For a while, I used BBEdit’s single Scratchpad.txt file and just set a hotkey in Alfred to open or display the little window. With this method I wouldn’t keep the text, just delete it and have a fresh Scratchpad.txt when I felt like it. I also played around manually creating a new scratchpad text file daily, but the point of a scratchpad is that it’s just always there when you need it, no fuss.

Today, I finally broke down and made an Applescript that is initiated by a hotkey via Alfred. I hope it will solve my problem. It does three things:

  1. Creates a new date-stamped text file for today, if one doesn’t exist
  2. Opens up today’s date-stamped text file, if the file already exists
  3. Sets the window size of your last scratchpad text file1.

This solves for a few issues. It makes management easy because I don’t have to manually create a new file and name it with today’s date stamp, scratchpad files are only created when I need them so I don’t have hundreds of empty text files, and the most important thing: it’s always where I need it to be, one keystroke away.

You can download the script if you’re interested. To use the 12-01-31 date format in the filenames2 you’ll have to change the format in System Preferences > Language & Text > Formats > Customize. The script is set up with my path and filename preference but you can obviously change it to anything you’d like. You’ll also be able to make it work with TextMate, TextEdit, or whatever editor you use by changing which application you tell.

I’d love to know what kind of Applescript/text file hacks you use. Tweet me or email me at the links below.

Update (12-07-30): Mountain Lion made something in this script a little wonky. Here’s an updated version that fixes it.


  1. BBEdit opens up new windows pretty large, especially on a Cinema Display.↩︎

  2. This is the output of short date string of (current date).↩︎