Remember the Milk Bookmarklet

Here’s a quick little hack that I found today while at work.  I’ve been on a bookmarklet kick recently and I discovered today that Remember the Milk, a great online to do list manager, has one for quickly adding new tasks.  You can read about it here.  It’s great, but with the magic of javascript it can be made even better.

I found that clicking the bookmarklet while on a page opens the ‘Add Task’ page with the title of the current web page filled in.  This is great if the title of the page contains the info you need, but for my browsing behavior this wasn’t ideal.  Sometimes I’d click a link, find a long article and I’d want to quickly add it to my to do list so that I can read it later.  So with one small change to the javascript, I was able to get this to work they way I wanted.

To be just like me (you know you want to), open Firefox and create a new Bookmark on the ‘Bookmarks Toolbar’, call it whatever you want, and then set the following as the location:

 javascript:(function(){h=’www.rememberthemilk.com’;p=’/services/ext/addtask.rtm’;if(window.getSelection){d=window.getSelection();}else%20if(document.getSelection){d=document.getSelection();}else%20if(document.selection){d=document.selection.createRange().text;};cp=’http://’+h+p+’?d=’+encodeURIComponent(d)+’&t=’+encodeURIComponent(document.URL);w=window.open(cp,’addwindow’,’status=no,toolbar=no,width=475,height=260,resizable=yes’);setTimeout(function(){w.focus();},%20500);})();

Now when you click the bookmarklet in your browser the current page URL will be filled into the form and added to your to do list.  I think this works the same in IE, Safari, and Opera, but I haven’t tested it.  Try it out and let me know if it works.  If you know any cool javascript hacks that could auto submit the form on the ‘Add Task’ page, please let me know as that would be cool too.


Details