Tuesday, June 2

Evernote and Launchy Integration

So, as of version 3.0.0.842 for Windows and 1.18 for Mac, Evernote has had scripting capabilities that allow for the automation of, among other things, the addition of notes. You can get notes on the scripting here: http://www.evernote.com/about/developer/.

Well, since this post is about Launchy and Evernote, obviously I am writing about the Windows scripting. There is Mac scripting ability via AppleScript, but I don’t have a Mac, so if anyone cares to share the same thing in AppleScript, please send me an email and I will add a link to this post.

To start with, I really love Evernote because it’s the first app out there that allows me to sync seamlessly between machines. I used to use OneNote, but it was tied to one machine or the other and without Live Mesh or another syncing program, there was no sync. Also, I have a Blackberry, so no mobile notes.

So now, I use Evernote for my GTD implementation and can capture home items and work items anywhere—including on my Blackberry. Great OCR on photos, too. I won’t get into my GTD system here as that’s for another post.

I use Evernote to capture tasks and reference material for just about everything and wanted a quick way to do this at my desk. I ended up using the command line scripting from Evernote to integrate into Launchy.

Setup

Obviously, first you need to have Evernote and Launchy installed. If you don’t have them, go get them.

Environment Variables

Next, you need to find the enscript.exe directory for Evernote and put it in your Windows Path Environment Variable. Typically, the Evernote directory will be
C:\Program Files\Evernote\Evernote3.” Go to Computer in Win 7 or Vista or My Computer in Win XP and right click and select Properties.

win_properties

From there in Win 7 or Vista, find Change Properties

change_settings

Then Environment Variables on the Advanced tab

env_var

Find the Path variable and add the path to enscript.exe.

image

Scripting Overview

Let’s look at the scripting, now. One thing to do first is to put a text file in the Evernote directory that simply has a space in it. To add a note to a notebook, you need to pass a text file. I haven’t found a way around this or a way to pass text in through the command line.

The basic format for my note adding script is:

enscript createnote /n NOTEBOOK-NAME /i TITLE /s PATH-TO-TEXT-FILE

So, a script to add a new action to my inbox would be:

enscript createnote /n @inbox /i “Title” /s "C:\Program Files\Evernote\Evernote3\blank.txt"

You can try this out in your command line, but make sure you put that blank.txt file in place first. If you don’t have an @inbox notebook, it will automatically get created.

Launchy Setup

Next, you are ready to setup Launchy. What you are going to do is add to the Runner plugin that Launchy comes with by default. I will show you how to set up a Next Actions list, but this can be repeated for any other notebook or list.

Personally, I set up a new notebook for different lists. You can take a look at the documentation on Evernote scripting to look into using tags to do something similar. I just populate a subject line with a new list item that I can add notes to later if I choose.

To implement in Launchy, first hit Right-Alt and Space to bring up Launchy and click the little gear to get to the Options panel:

launchy

Next, go to the Plugins tab and go to Runner. Click the plus sign button at the bottom of the tab to add a new option for runner.

There are three sections you will need to create:

  1. The shortcut name that you will type to add a note
  2. The script that is being run
  3. The parameters

For my inbox, I just call it “in.” For the script, put in enscript. Since this is added to the Windows path, there is no need to give the full path.

Next come the parameters. This was the script that works in the command line:

enscript createnote /n @inbox /i “Title” /s "C:\Program Files\Evernote\Evernote3\blank.txt"

To make it work with Launchy to pass in text for the title, though, you need to replace the word Title with $$. This will then put in any text you enter into Launchy into the title of the note.

Your entry should look something like this:

line

Setup is done now.

Using It!

Now, just hit Right-Alt and Space to get Launchy. Type in and hit tab. It should look like this:

launchy2After the arrow, enter the text for the title and hit Enter.

launchy3Open up Evernote and you should see your note.

evernote  

Feel free to leave comments if you have any questions!

4 comments:

Dennis said...

Great idea for use with Launchy and Evernote. I just recently discovered Evernotes scripting capability and set up something similar, but did it from a batch file. The batch file sets the appropriate paths for everything.
I also pass two parameters from Launchy so that I can enter a note title as well as text in the body. You could probably pass a third parameter to indicate the notebook the entry is targeted for. My batch file goes like this...

echo off
echo %2 > W:\Documents\My EverNote Files\tempevernotetext.txt
C:\Progra~1\Evernote\Evernote3\ENScript.exe createNote /i %1 /d "W:\Documents\My EverNote Files\DataBases3\myevernote.exb" /s "W:\Documents\My EverNote Files\tempevernotetext.txt"

Then my entry in the Launchy Runner plug-in uses the batch file as the target under programs. Under the arguments I enter...
"[_] $$" "$$"
The first entry for the title provides for a simulated check box. The downside at this point is that the note entry always has quotation marks around it.

Jeff Small said...

i like this! i may actually use this myself. i had a hard time trying to get a way to get text into the body.

my windows batch scripting skills had long vanished from my brain after moving from development to project management a few years ago. thanks for helping to clear those cobwebs!

Jeff Small said...

to remove quotes in a parameter, refer to this:

http://www.computing.net/answers/programming/remove-quotes-from-user-input-string/19410.html

just substitute your variable %2 with %~2

Dennis said...

Well that was an easy fix - Thanks! I don't think I've done any serious DOS batch files since the early 90's, but its interesting what I can still remember.

I found another easy way to get data to Evernote is with a new service at futz.me. The downside is that this emails to your Evernote web site, so doesn't immediately show up in your notebook until you sync. Also haven't figured out how to get data in the body of the note, but it will work from any browser address bar, and you can easily use the Weby plugin for Launchy to do this.