Updated: Post NetNewsWire Items to Evernote

February 17th, 2009  |  Published in ruby  |  5 Comments

Updated: Look at the comments. Ed points out that you don’t need FastScripts to add a Ruby script to the script menu. Use the Keyboard Shortcuts pref pane to tie it to a shortcut (which is much better than the old “name the script with underscores and pixie dust to get a shortcut” method.)

I started using Evernote in earnest over the past week. The big motivation to get started came from the benefits of clipping things at home and pulling them down from my iPhone while out of the house, which was something we needed to do a lot over the weekend.

Evernote’s first Mac iteration wasn’t very grand: No scripting support, no way to export notes. Those issues have been addressed, so what you’re left with is something very much like Yojimbo, only with a really good mobile client, network sync (that doesn’t involve MobileMe), multi-platform support and publicly shareable notebooks. (Here’s Evernote in a nutshell.)

The scripting syntax is as clean as anything, so it was pretty simple to adapt my NetNewsWire => InstaPaper script to save stuff from NNW to Evernote.

A quick recommendation on running Ruby appscripts in OS X: Red Sweater Software’s FastScripts, which provides an enhanced script menu that lets you run scripts written in something besides Applescript, and which allows you to assign keyboard shortcuts to those scripts. The InstaPaper and Evernote scripts I’ve got for NNW are tied to cmd-opt-i and cmd-opt-e respectively.

    #!/usr/bin/env ruby
    require 'rubygems'
    require 'appscript'
    require 'sanitize'
    include Appscript

    nnw = app("NetNewsWire")
    en = app("EverNote")

    item = nnw.selectedHeadline.get
    url = item.URL.get
    title = item.title.get

    description = Sanitize.clean(item.description.get)

    note = en.create_note(:title => title, :notebook => "Inbox", :with_text => description)

    note.source_URL.set(url)
    

  • http://www.goesping.org/ Ed Heil

    If you use Library/Scripts/Applications (the global script menu, instead of Library/Application Support/NetNewsWire/Scripts/, you can use any scripting language even w/o FastScripts.

    Remind me sometime to show you the insanely special-purpose script I made by fusing your “post to instapaper” with a script I’d written previously to download images from http://goldenagecomicbookstories.blogspot.com/ for easy fullscreen slideshow viewing. :)

  • mph

    Hey … so you can! FastScripts has a few other conveniences, but that works for free and the Keyboard Shortcuts prefs pane works with it.

  • Pingback: Evernote Applescript Resources | Veritrope

  • Nick

    Wrong place for support, no doubt, but I couldn’t help asking you seeing as we are using the same tools. Are you running the Leopard standard install of ruby. When I execute ruby scripts through FastScripts the shebang appears to resolve to the standard Leopard ruby interpreter and not my updated MacPorts installation.

    Thanks Nick

  • http://mph.puddingbowl.org mph

    Hey, Nick. Standard install, I’m afraid. So, #!/opt/local/bin/ruby or wherever MacPorts is doesn’t do the trick?

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.