Evernote and MarsEdit

I use MarsEdit to post most of the articles (if you want to call them that) I write here. It’s a great application, but I don’t like writing draft posts in it because there’s no way for me to access them when I’m not on my Mac (at least not until Daniel gives us MarsEdit for iOS). I’ve tried to write my drafts in text files stored in Dropbox using vim, TextMate, nvALT and Byword and then mashing together some combination of AppleScripts, shell scripts, and TextExpander snippets to easily get the content into MarsEdit. Every “solution” was hacky and I grew dissatisfied with them all so quickly that I lost track of which one I was using at a given time. But since The Switch to Evernote, I’ve come up with what could be the One True Blogging Workflow for me.

I created a notebook in Evernote called @macolyte_drafts where I keep a note, written in Markdown, for every post I’m currently working on. Once I’ve given up on trying to make the post sensible, I hit ⌘ ⇧ M and the following AppleScript is run (thanks to another one of Daniel’s excellent applications: FastScripts) to turn the note into a new blog post entry in MarsEdit:

(Some bits of the code are from here and here

After the piece is published, the note gets moved to the @macolyte_pub notebook (sadly, Evernote doesn’t support moving a note from one notebook to another via AppleScript so I have to do it manually). And that’s it. My drafts are always with me and getting them published is not in any way hacky.

Evernote Quick Search with LaunchBar

For the next installment of my Evernote and AppleScript series, I present a really simple script that allows me to search my Evernote database from LaunchBar:

Instead of switching to Evernote, clicking on the search field and typing my search, this lets me do it all from the keyboard without leaving whatever other application I happen to be using. I just invoke LaunchBar, switch to text entry mode, type my query and hit Return. Boom. A new Evernote window pops up with my search results.

Evernote Daily Log with LaunchBar

I’ve always thought Evernote would make for a workable place to keep something like a daily log, but I could never find a friction free workflow to make it happen. However, I was recently reminded that LaunchBar is more than just an application launcher and can execute actions, which can be AppleScripts. Since I know a little AppleScript, I wrote one that would basically solve this problem:  

Now all I have to do is invoke LaunchBar, hit space the switch to text entry mode, and type my text. A new note is created in the Log notebook with the current date as the title. If a note with that title already exists, the new text is appended to it. Each “entry” is prepended with a timestamp and the pipe character like this: 12:34:56 |. It also pops up a nice friendly message if, for some reason, there are two notes with the same name in the Log notebook.

If you choose to use this, and the format I chose doesn’t appeal to you, or you want to use a different notebook, it should be fairly straightforward to see where those things can be changed in the script. Of course after writing this I found another daily diary script that I’m sure is much better written than mine, so you can check that out as well if this sort of thing interests you.

I’m pretty happy with how this turned out, but sadly I can only use it on my Mac (and even then only until Apple kills off AppleScript support). It would be nice if I could use it on my iPhone/iPad and especially useful on the shitty PC they make me use at work. It’s not impossible to do on either platform, just not quite as smooth. If Evernote on iOS supported TextExpander Touch it would be helpful, but it doesn’t. Fastever does support TextExpander and could be used for creating the initial note for a given day, but I don’t think you can append to notes once they’ve been created. At work, I’m experimenting with Breevy and the PC client and it’s working ok so far. But these are still workarounds; no amount of text expansion will change the fact that I still have to launch the application instead of just hitting a quick keyboard shortcut. That friction could make all the difference between actually using it regularly and not.

Evernote

I’ve decided to abandon my plain text note-taking system in favor of EvernotenvALT and Byword, Elements and PlainText, these are all great applications and I’ve gotten a lot of use out of them over the years, but there was one use case that they weren’t addressing for me: sometimes it’s helpful to have images, or some other kind of non-textual data, accompany a note. The plain text editors just don’t do that (by design and rightfully so). I’ve used Evernote off and on to clip interesting things from the Internet and I think it would be easier for me if everything was in one place instead of scattered across multiple applications.

After deciding to take the plunge I whipped up an AppleScript to import all of my existing text notes into Evernote:  

I saved it as an application, selected all the text files and dropped them onto it. A few minutes later they were all in Evernote, with the note’s creation date set to the original file’s creation date.    It’s also trivially easy to turn the script into an OS X Service, so if you find yourself wanting to import random files from the Finder into Evernote you can. To do that: 

  1. Open Automator and create a new Service. 
  2. Set the Service receives selected dropdowns to files or folders in Finder.app.
  3. Find the Run AppleScript action in the left hand pane and drag it over to the right.
  4. Copy the repeat block above and paste it into the on run block in Automator.
  5. Change the file_list variable to input.
  6. Save it with a sensible name like Import File to Evernote.
  7. There is no step 7.

You could also use an application called ThisService, which takes an AppleScript and turns it into a Service, but I’ve personally never used it and it hasn’t been updated since 2008. I don’t see why it wouldn’t still work though.

I’ve got a few posts about some other useful things I’m doing with Evernote in the pipeline and will share them in the near future. So stay tuned. 

Weekend Project: Evernote Dated Photo

Back in September Brett Kelly wrote a neat little Python/Applescript tool called Evernote Dated Photo:

When you add an image to Evernote using this app, it will set the “created” date on the note to be the same day the photo was taken.

As originally written, it could only handle adding one photo at a time to your default notebook. Brett put the project up on github, so I forked it and added multiple file/folder support as well as the ability to select which notebook to add the photos to. I learned a bit about AppleScript from working on this and I’m flattered that Brett thought my changes were good enough to merge into the project.

I also made a very low production value screencast to demo how it works:

Check out Brett’s Evernote Essentials book too.