Quickly opening a your idea collection text file on the Mac via Apple Script

Write down the thoughts of the moment. Those that come unsought for are commonly the most valuable.
Francis Bacon

If you have ideas when working on the computer, I highly recommend to jot them down immediately. Not only are you less likely to forget it, you also get your mind clear again to continue working.

You can use a simple text file and put it in the Dock. But that requires you to use the mouse. You can also open it with Spotlight on the Mac. After all, Spotlight can display search results in your Documents folder. Just search for the file name and press enter.

However, unless you chose a unique name, you might accidentally open the wrong file. Also, I have disabled Spotlight for anything but Applications (via the System Preferences > Spotlight). Given my files are in DEVONthink (and I have also disabled Spotlight index there), if I need a file, I open it by double-clicking it (actually, one click on a gaming mouse that is configured as double-click). I am a fan of clear hierarchical organization, not of computer-wide search.

So, I decided to write a short Apple Script to open a specific file with a specific app and saved it as an application — and it works like a charm. Whenever I type the first two letters of the application name in Spotlight (via cmd + space), I get the application that opens my collection inbox text file. The file in which I jot down the ideas I have when doing something else.

The code itself I quite short (I followed mysterytramp’s suggestion here):

tell application "TextWrangler"
open "Users:mainUser:Documents:personalNotes:collectionInbox.txt"
end tell

Just copy-paste it in the Script Editor on MacOS (/!\ no warranty /!\) and specify the text editor you use (and yup, I use TextWrangler) and take care to specify the exact path to the file. The activate is important to have the next window move to the front.

To save the script as an application, just hold the “alt” key and click File to see the “Save as …” option and save it as an application (test it first!).

Works like a charm.