Home Link

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

Posts Tagged ‘service’

  • 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…”

Dec 31
2009

Down­load the Eval­u­ate Expres­sion Snow Leop­ard ser­vice: EvaluateExpressionService.zip

This is a stripped down ver­sion of a com­mand I have in the Text­Mate bun­dle we use at TUAW. It allows you to select any basic numeric equa­tion and eval­u­ate it, replac­ing the selected text with the results. It will ignore your text if it con­tains any­thing but num­bers and basic math­e­mat­i­cal sym­bols. Sure, there are plenty of ways to do cal­cu­la­tions in OS X (Spot­light, Launch­bar, Quick­sil­ver), but I’ve had more and more inci­dents lately where I just wanted to do quick cal­cu­la­tions inline, so I whipped this up. A lit­tle explanation…

Con­tinue read­ing “A (fairly) sim­ple equa­tion eval­u­a­tion ser­vice for Snow Leopard…”

Nov 12
2009

This is a quick and dirty Snow Leop­ard Ser­vice that scrapes Songza.fm to find a song related to your selected text in most appli­ca­tions. It replaces the selected text with an is.gd short­ened link and the name of the first song it found (just to be sure you’re on the same page… lit­er­ally). The code is also avail­able as a Text­Mate com­mand for those inter­ested. Update: Text­Mate com­mand with link selec­tion popup.

The ser­vice (and Text­Mate com­mand) require the Hpri­cot gem for ruby. In most cases, this should be instal­lable from the com­mand line with sudo gem install hpricot. If you see errors, you may need to update some Ruby com­po­nents. Once that’s set, just install the work­flow in ~/Library/Services and it should imme­di­ately start show­ing up in your ser­vices menu. Add a short­cut for it in Pref­er­ences -> Key­board -> Short­cuts -> Ser­vices. Next time you’re tweet­ing or writ­ing an email about a song, why not send a Songza link to back up your point?

Con­tinue read­ing “Songza Lucky Link Service…”

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