VoodooPad Bookmarklets

VoodooPad bookmarklets make it easy to log search results. I keep a worklog in VoodooPad. Notes for each day are stored in a page with a name of the form 'yyyy-mm-dd'. When I'm searching for info on the web, I like to include relevant results in my worklog. I tend to record results in this format, to make it easier to find the results again in future:


It's tedious to format these excerpts. At least two visits to the browser application are needed:

  1. Copy the URL
  2. Copy the text of interest

Luckily VoodooPad supports application-specific URLs, and you can create JavaScript bookmarklets to open such a URL, with the URL and any selected text for the page you're currently viewing.

Here's an almost human-readable example of a bookmarklet which adds an excerpt from the current web page, formatted as above, to the current worklog page in VoodooPad. (Sorry for the messed-up syntax listing. Apparently Wordpress -- or maybe MarsEdit -- is trying to insert smart quotes.)

var d = new Date();
var padded = function(v) {
    var res = v.toString();
    while (res.length < 2) {
        res = '0' + res;
    return res;
var page = [
    padded(d.getMonth() + 1),
location.href = ('voodoopad:description=' + 
                 encodeURIComponent(location.href + '\n"""\n' + 
                                    window.getSelection().toString() + 
                                    '\n"""\n') +
                 '&page=' + page);

Here's the same bookmarklet formatted for inclusion in your browser's menubar: