Mar 06
2010
Another post, quickly and with less explanation…
The fact that Evernote processes HTML so much better than it does plain or rich text got me thinking and tinkering. I use Markdown (actually, MultiMarkdown) constantly, and it does a great job of turning plain text into valid markup. With (Multi)Markdown, even plain text becomes HTML that–when imported into Evernote–retains most of its formatting. To answer your question, no, I’m not obsessed with Evernote, I’m obsessed with problems I think I could solve. It’s unhealthy.
Please note, this requires that you have Fletcher Penney’s MultiMarkdown installed in ~/Library/Application Support/MultiMarkdown, and that the Perl files (MultiMarkdown.pl and SmartyPants.pl) are located in a ‘bin’ subdirectory (which is the default install). If you don’t have MultiMarkdown, you should get it anyway (all the cool kids have it), so head over to the download page and grab a copy. Now, on with the show.
I set this up originally as a TextMate command, intending just to be able to clip code snippets and free-form text to Evernote without thinking too much about it. That worked well, so I modified it to work as a System Service. Specifically, a Snow Leopard service, but I’m providing the Ruby script here and it can be modified for any Mac setup you want.
While it will work just fine on plain text with no markup, it does have a couple of “special” features. If you start a line with a # and a space (e.g.: # This is my header), which is a Markdown convention for a first-level heading, it will use that as the title for the note and strip it out of the text in processing. It only uses the first one it finds, but it will strip out any first-level headers in the selection. I’ll probably modify that later, or just have it leave them in. Also, a line that begins with “tags:” followed by a space and a comma-separated list of words will be split up and used to tag the new note. This is also stripped before processing. It handles spaces in multi-word tags, and odd marks at the beginning or end of a tag, but only one punctuation character, and only at the beginning or end of a tag. The code follows…
Continue reading “A better System Service for Evernote clipping — with MultiMarkdown…”
Mar 06
2010
I primarily use Safari for web browsing, mostly because it’s smoother and faster than Firefox, and the Web Inspector is just as useful as Firebug. As time passes, I end up with a lot of web pages open, and I like to clear out my browser tabs on a regular basis. Safari doesn’t really have a long-term session-saving option, so I save lists of open tabs to various applications. I used to use SafariStand to do this, but it got too buggy and slow for me. I use VoodooPad for it, but I like the sorting and searching option in Evernote, both on my desktop, and synced online and to my iPhone.
As much as I love Evernote, its editor is, well, a hassle. Importing text clippings can strip line breaks and leave you with quite a mess, and cleaning it up is less than pleasant. I’ve found that using AppleScript, HTML and Evernote together allows me to create pretty well-formatted notes from web and text clippings, aside from using Evernote’s PDF features. In most cases—like website clippings—I don’t need or want a full PDF, replete with ads and comments (Clippable was designed with that in mind). The trick when creating a note in Evernote via AppleScript is to use a little HTML to get the basic formatting. Evernote’s AppleScript library provides a command tailored to this purpose.
To demonstrate, I’ll show you how to save your browsing session in Safari as a nicely formatted list in Evernote. For this I set up a new Notebook called “Bookmarks,” and am keeping the markup very simple. Evernote strips most styling from imported HTML, but accepts structural items like headlines, lists, tables, etc., applying its own default formatting to the elements.
Continue reading “Saving Safari browsing sessions to Evernote…”
Dec 31
2009
I made a couple of minor changes to the Clippable bookmarklet, mostly in the way it handles SyntaxHighlighter code blocks. The SyntaxHighlighter plugin is used (too) often to format and color code source snippets in websites. The result when clipping a page is that the code you get still has line numbers, but no option to view the raw source without going back to the web page. Then you end up manually editing out the line numbers if you want to copy and paste the code, which can be a pain in most cases.
Since the point of Clippable was to deal better with things like code blocks (especially for saving snippets to Evernote), it now removes the toolbar and line numbers from SyntaxHighlighter blocks. It also looks for another common technique: converting lines in code to an ordered list inside of a pre block. This is just blotted out with CSS now. Those are the only two highlighting methods it targets at the moment, but I’ll tackle more as I run into them.
If you already have the bookmarklet installed, you’re already benefitting from these changes (the bookmarklet calls the source scripts on my server, so it is, in essence, automatically updated). If not, just cruise over to the Clippable page and grab it!
Nov 03
2009
Clippable to Evernote will allow you to trigger the Clippable bookmarklet in Safari and copy the result directly to your “Unfiled” notebook in Evernote. This service is Snow Leopard-only. If you need it modified for Leopard and aren’t sure how, let me know. If there’s some interest, I’ll just work one up and post it.
To install in Snow Leopard, just unzip (double-click the zip file) the file and move the resulting .workflow file to [your home directory]/Library/Services. It should now appear in your Safari->Services menu, in Safari only. To add a keyboard shortcut to the Service, go to the Keyboard pane in System Preferences, choose the Keyboard Shortcuts tab, select Services on the left and find the Clippable… service on the right. Double click on the right side of the listing to enter a hotkey. I currently have mine bound to control-command-E, which works well for me in Safari.
Download here.
Nov 02
2009
So my modification of the Readability bookmarklet kind of snuck out before it was ready, but it’s my own fault. Now I’m scrambling a little to make it more presentable and less of a straight-up hack of the excellent original. I wanted to make a few things clear about my goals and purpose on this one.
First the entire project was really a subset of my attempt at a better Evernote clipper for Snow Leopard. One which allowed me to preserve code formatting and automatically remove comments and ads from the post, in a smarter fashion than the current Safari clipper does. I built it as a System Service and run it with a hotkey. You can download it and try it out, if you like. I’ll make a more accessible version with instructions shortly.
This is why I removed the formatting options from the bookmarklet… Evernote was going to strip all of that out anyway. Originally, I was just using the code to strip out ads and find the meat. The modifications to preserve code blocks, movies, etc. were simply working toward the “perfect” Evernote clip.
It works for what it is, but wasn’t really intended to be used without the Evernote Service. If I get enough feedback, and no cease and desist orders from the original creators, I’ll continue to modify it. One thing you can certainly do to help is provide me with URL’s to pages it fails on; the more scenarios I can study, the smarter I can make it.