Post Tasks to RememberTheMilk with a Custom Firefox Button

Posted by jay on July 17, 2007 under Firefox Extensions, HOWTO, Productivity, Tips | Be the First to Comment

This is a very easy hack that I created today.

Prerequisites

Once you've got a RTM account setup and the Custom Buttons extension installed you're ready to add the button.

In FF click View->Add new button....
A dialog box will appear with space to add a Name, an Image, some Code and Initialization Code.

The name and image are self explanatory. The Code box is where you'll paste the code below which will launch a new window that displays a form to add a new RTM task. The Initialization Code box is for code that will run when the browser starts up.

Past this JavaScript code into the Code box which will launch the RTM dialog when the custom button is clicked.

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

Click OK to save and close the dialog and then click View-Toolbars-Customize and add your new button to a toolbar.

Clicking the button will launch the RTM form and now you can add tasks right from Firefox.