I’ve been promising this post for a while now, but before we get down to the nitty-gritty, we need to learn how to create note templates in Evernote for Windows (The process is different if you’re on a Mac. I’ll cover note templates in Evernote for Mac in the next post…stay tuned). I stole most of my ideas from Stephen Millard over at Thought Asylum, so I recommend checking out his posts on Evernote at some point.
In order for the template system to work, you’ll need to download and install a few things first:
- A text editor – I recommend Notepad++. You can download it here.
- AutoHotKey – AHK is really simple to use. For a quick overview, read through this Lifehacker article.
The text editor is used to edit the Evernote template and to create a batch file. AHK is used to create a keyboard shortcut that automatically imports your template into your default notebook.
Once the two programs are installed, open Evernote and create a new note. Add any title, tags, and note content that you want, and when you’re satisfied choose the ‘Export…’ option from the File Menu.
Select ‘Export as a file in ENEX format (.enex)’ and click the ‘Export’ button.
Give the file a name and save it somewhere where you’ll be able to find it. I recommend creating an ‘Evernote Templates’ folder in ‘My Documents’ and saving the file there.
Find the file in Windows Explorer and open it with Notepad++ (or your text editor of choice). Near the end of the file, after the closing ‘content tag’ (looks like this: </content>) there should be a set of ‘created tags’ with some numbers/text in between. For example:
Delete both tags and the text/numbers between them. There may also be ‘updated tags’ (<updated></updated>). Delete these also along with the numbers/text between them. Save and close the template file.
This step ensures that when you import your template file back into Evernote it will have the proper creation date. If you skip this step, the note’s creation date will always be the date you first exported the template.
Now let’s create the batch file. Using your text editor, you want to create a file that looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@echo off :CONFIGURATION Set ENScriptLocation="C:\Program Files (x86)\Evernote\Evernote" Set EvernoteDatabase="C:\Users\Your Windows Username Here\AppData\Local\Evernote\Evernote\Databases\simplecuriosity.exb" Set TemplateFile="C:\Users\Your Windows Username Here\Documents\Evernote Templates\Sample Template.enex" Set Notebook="1. Inbox" :START cd %ENScriptLocation% ENScript ImportNotes /s %TemplateFile% /n %Notebook% /d %EvernoteDatabase% :CLEAN-UP cls exit
The ‘ENScriptLocation’ is the folder on your computer where the Evernote.exe file is located. Change the location if necessary. To Find ‘EvernoteDatabase’, in Evernote, select ‘Options’ from the Tools Menu and click ‘Open Database Folder’. A new Windows Explorer window should open. Find the file that has your Evernote username ending in .exb (in my case, simplecuriosity.exb) Hold down the ‘Shift’ button on your keyboard, and right-click the file with your mouse. You should see an option to ‘Copy as path’. Select this option and paste the path you just copied into the batch file after ‘EvernoteDatabase=’. Now, open the Evernote Templates folder you created earlier and copy the path to your template file. Paste this path into the batch file after ‘TemplateFile=’. If you want to change which notebook the template will be imported into, change ‘1. Inbox’ to the name of a different notebook. Once you are all finished, save the file in the Evernote Templates folder. Give the file the same name as the exported template file, but make sure it ends in .bat (i.e. ‘Sample Template.bat’).
That may have been a bit confusing. If you have any questions, leave a comment below.
Now let’s turn to AutoHotKey. If you are already familiar with AHK you can simply add the 2 lines of code below to your existing AHK script. If you are a new user, however, you’ll need to lay a bit of groundwork first. I won’t go into too much detail, so if you are confused or want to learn more, you can find the AHK quick-start tutorial here. To create a new AHK script:
- Right-click an empty spot on your desktop or in any folder.
- In the menu that appears, select ‘New’ –> ‘AutoHotKey Script’.
- Name the file ‘Main AHK Script.ahk’.
Open the script file with your text editor. Delete any text in the file and paste in the following 2 lines of code:
;; Windows Key + t -> Opens template file in Evernote #t::Run "C:\Users\Your Windows Username Here\Documents\Evernote Templates\Sample Template.bat"
That’s it. Save the file and exit the text editor. You’ll want to make sure the script loads each time your computer starts. To do so, move the script file to the Windows Startup folder. In Windows 7, the Startup folder is located here:
"C:\Users\Your Windows Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Double-click the script file to make sure it’s running (An icon should appear in the notifications area. You can pause, edit, or reload the script directly from here). Now it’s time to test out our template!
Open Evernote. Press the Windows Key + t. Voila! Your template note should appear in the ‘1. Inbox’ notebook.
In the next post I’ll show you how to create templates in Evernote for Mac. The process is a lot different. After that, I’ll show you how this all relates to GTD and Projects. Cheers.
Update – If you get the batch file and AHK script working, could you please leave a comment below. Some readers aren’t getting the expected results, and I want to verify that there isn’t a problem with the code/instructions.