Home Link

Hello, my name is Brett Terpstra, and it’s nice to meet you. Elegant solutions to complex problems. Curious?

Posts Tagged ‘evernote’

  • Jan
  • Feb
  • Mar
  • Apr
  • May
  • Jun
  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

Mar 06
2010

Another post, quickly and with less explanation…

The fact that Ever­note processes HTML so much bet­ter than it does plain or rich text got me think­ing and tin­ker­ing. I use Mark­down (actu­ally, Mul­ti­Mark­down) con­stantly, and it does a great job of turn­ing plain text into valid markup. With (Multi)Markdown, even plain text becomes HTML that–when imported into Evernote–retains most of its for­mat­ting. To answer your ques­tion, no, I’m not obsessed with Ever­note, I’m obsessed with prob­lems I think I could solve. It’s unhealthy.

Please note, this requires that you have Fletcher Penney’s Mul­ti­Mark­down installed in ~/Library/Application Support/MultiMarkdown, and that the Perl files (MultiMarkdown.pl and SmartyPants.pl) are located in a ‘bin’ sub­di­rec­tory (which is the default install). If you don’t have Mul­ti­Mark­down, you should get it any­way (all the cool kids have it), so head over to the down­load page and grab a copy. Now, on with the show.

I set this up orig­i­nally as a Text­Mate com­mand, intend­ing just to be able to clip code snip­pets and free-form text to Ever­note with­out think­ing too much about it. That worked well, so I mod­i­fied it to work as a Sys­tem Ser­vice. Specif­i­cally, a Snow Leop­ard ser­vice, but I’m pro­vid­ing the Ruby script here and it can be mod­i­fied for any Mac setup you want.

While it will work just fine on plain text with no markup, it does have a cou­ple of “spe­cial” fea­tures. If you start a line with a # and a space (e.g.: # This is my header), which is a Mark­down con­ven­tion for a first-level head­ing, it will use that as the title for the note and strip it out of the text in pro­cess­ing. It only uses the first one it finds, but it will strip out any first-level head­ers in the selec­tion. I’ll prob­a­bly mod­ify that later, or just have it leave them in. Also, a line that begins with “tags:” fol­lowed 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 pro­cess­ing. It han­dles spaces in multi-word tags, and odd marks at the begin­ning or end of a tag, but only one punc­tu­a­tion char­ac­ter, and only at the begin­ning or end of a tag. The code follows…

Con­tinue read­ing “A bet­ter Sys­tem Ser­vice for Ever­note clip­ping — with MultiMarkdown…”

Mar 06
2010

I pri­mar­ily use Safari for web brows­ing, mostly because it’s smoother and faster than Fire­fox, and the Web Inspec­tor is just as use­ful as Fire­bug. As time passes, I end up with a lot of web pages open, and I like to clear out my browser tabs on a reg­u­lar basis. Safari doesn’t really have a long-term session-saving option, so I save lists of open tabs to var­i­ous appli­ca­tions. I used to use Safari­S­tand to do this, but it got too buggy and slow for me. I use VoodooPad for it, but I like the sort­ing and search­ing option in Ever­note, both on my desk­top, and synced online and to my iPhone.

As much as I love Ever­note, its edi­tor is, well, a has­sle. Import­ing text clip­pings can strip line breaks and leave you with quite a mess, and clean­ing it up is less than pleas­ant. I’ve found that using Apple­Script, HTML and Ever­note together allows me to cre­ate pretty well-formatted notes from web and text clip­pings, aside from using Evernote’s PDF fea­tures. In most cases—like web­site clippings—I don’t need or want a full PDF, replete with ads and com­ments (Clip­pable was designed with that in mind). The trick when cre­at­ing a note in Ever­note via Apple­Script is to use a lit­tle HTML to get the basic for­mat­ting. Evernote’s Apple­Script library pro­vides a com­mand tai­lored to this purpose.

To demon­strate, I’ll show you how to save your brows­ing ses­sion in Safari as a nicely for­mat­ted list in Ever­note. For this I set up a new Note­book called “Book­marks,” and am keep­ing the markup very sim­ple. Ever­note strips most styling from imported HTML, but accepts struc­tural items like head­lines, lists, tables, etc., apply­ing its own default for­mat­ting to the elements.

Con­tinue read­ing “Sav­ing Safari brows­ing ses­sions to Evernote…”

Dec 31
2009

I made a cou­ple of minor changes to the Clip­pable book­marklet, mostly in the way it han­dles Syn­tax­High­lighter code blocks. The Syn­tax­High­lighter plu­gin is used (too) often to for­mat and color code source snip­pets in web­sites. The result when clip­ping a page is that the code you get still has line num­bers, but no option to view the raw source with­out going back to the web page. Then you end up man­u­ally edit­ing out the line num­bers if you want to copy and paste the code, which can be a pain in most cases.

Since the point of Clip­pable was to deal bet­ter with things like code blocks (espe­cially for sav­ing snip­pets to Ever­note), it now removes the tool­bar and line num­bers from Syn­tax­High­lighter blocks. It also looks for another com­mon tech­nique: con­vert­ing lines in code to an ordered list inside of a pre block. This is just blot­ted out with CSS now. Those are the only two high­light­ing meth­ods it tar­gets at the moment, but I’ll tackle more as I run into them.

If you already have the book­marklet installed, you’re already ben­e­fit­ting from these changes (the book­marklet calls the source scripts on my server, so it is, in essence, auto­mat­i­cally updated). If not, just cruise over to the Clip­pable page and grab it!

Nov 03
2009

Clip­pable to Ever­note will allow you to trig­ger the Clip­pable book­marklet in Safari and copy the result directly to your “Unfiled” note­book in Ever­note. This ser­vice is Snow Leopard-only. If you need it mod­i­fied for Leop­ard and aren’t sure how, let me know. If there’s some inter­est, I’ll just work one up and post it.

To install in Snow Leop­ard, just unzip (double-click the zip file) the file and move the result­ing .work­flow file to [your home directory]/Library/Services. It should now appear in your Safari->Services menu, in Safari only. To add a key­board short­cut to the Ser­vice, go to the Key­board pane in Sys­tem Pref­er­ences, choose the Key­board Short­cuts tab, select Ser­vices on the left and find the Clip­pable… ser­vice on the right. Dou­ble click on the right side of the list­ing to enter a hotkey. I cur­rently have mine bound to control-command-E, which works well for me in Safari.

Down­load here.

Nov 02
2009

So my mod­i­fi­ca­tion of the Read­abil­ity book­marklet kind of snuck out before it was ready, but it’s my own fault. Now I’m scram­bling a lit­tle to make it more pre­sentable and less of a straight-up hack of the excel­lent orig­i­nal. I wanted to make a few things clear about my goals and pur­pose on this one.

First the entire project was really a sub­set of my attempt at a bet­ter Ever­note clip­per for Snow Leop­ard. One which allowed me to pre­serve code for­mat­ting and auto­mat­i­cally remove com­ments and ads from the post, in a smarter fash­ion than the cur­rent Safari clip­per does. I built it as a Sys­tem Ser­vice and run it with a hotkey. You can down­load it and try it out, if you like. I’ll make a more acces­si­ble ver­sion with instruc­tions shortly.

This is why I removed the for­mat­ting options from the book­marklet… Ever­note was going to strip all of that out any­way. Orig­i­nally, I was just using the code to strip out ads and find the meat. The mod­i­fi­ca­tions to pre­serve code blocks, movies, etc. were sim­ply work­ing toward the “per­fect” Ever­note clip.

It works for what it is, but wasn’t really intended to be used with­out the Ever­note Ser­vice. If I get enough feed­back, and no cease and desist orders from the orig­i­nal cre­ators, I’ll con­tinue to mod­ify it. One thing you can cer­tainly do to help is pro­vide me with URL’s to pages it fails on; the more sce­nar­ios I can study, the smarter I can make it.

Entries (RSS) and Comments (RSS).

Switch to Mobile version