In one of my previous tips I did a review on Firefox extension iMacro, the download URL and other information can be found here. In this tip I will demonstrate how iMacro can be used to clean your bombed mail inbox. If you have already installed iMacro, fire up Mozilla Firefox (or Internet Explorerif you have installed iMacro add-on for IE) and go to your login page. iMacro can be launched by clicking on its icon next to location bar or from Toolsmenu. |
iMacro panel can be found in the left bar of the browser. The first (top) part of the panel shows a list of available macros. The lower part contains controls for recording, editing and running macros. To start recording click on the “Rec” tab and then click on Record button. All your actions are now being recorded and can be played back later. Go to mail.yahoo.com (or any other site) and enter your username and password and go to your inbox. You can stop here and test how iMacro automates by logging out and clicking on play after going to the same login page. iMacro includes a sample macro for loggin into Gmail, you could play around with it just to find out how it works. Coming back to the topic, since what I want to do is delete mails on server, I would leave the login process out of the macro. Instead I would go straight to the Options|Mail Options|General Preferences and setmessages/results per page to the highest,which is 200. Most likely the maximum number of mails would have originated from a user group or community,identify the keyword and perform a search of your mailbox. In my case, I had less than a 100 important mails out of a total of 11,000. Once the unwanted mails are filtered and displayed, select the “Rec” tab and click on “Record” button. Then click on the hyperlink “Check all” to select all mails displayed on the page and then click on the Delete button. To stop recording, click on the “Stop” button. The script generated is named #current.iim but you can rename it to something that is easier for you to remember. We could now simply run the macro and perform the same operation repeatedly but we must remember that we are dealing with a search result and not a static page.So the URL recorded in the script might have changed. To take a look at the code generated select the “Edit” tab and click on the “Edit” button,the script is opened in the notepad and the code is as follows: |
VERSION BUILD=6111228 RECORDER=FX TAB T=1 URL GOTO=http://us.mc546.mail.yahoo.com/y5/s/search?&s=ydn&start=0&count=200 &key=date&order=down&view=message&frm=1&stype=basic &sqid=102000417497o6kc6fj04e6&&extraargs=%201.rand% 4D1S5017863%2qd2%4N1 TAG POS=1 TYPE=LI ATTR=ID:checkall TAG POS=2 TYPE=INPUT:SUBMIT FORM=ID:messagelist ATTR=NAME:op_delete&&VALUE:Delete TAG POS=2 TYPE=INPUT:SUBMIT FORM=ID:messagelist ATTR=NAME:op_delete&&VALUE:Delete
We can modify the script to load relevant URL everytime but in our case we don’t need it since we are operating on a search result and not conducting search automatedly. So simply removing the “URL GOTO” line should work for us. The modified code looks as follows :
VERSION BUILD=6111228 RECORDER=FX TAB T=1 TAG POS=1 TYPE=LI ATTR=ID:checkall TAG POS=2 TYPE=INPUT:SUBMIT FORM=ID:messagelist ATTR=NAME:op_delete&&VALUE:Delete TAG POS=2 TYPE=INPUT:SUBMIT FORM=ID:messagelist ATTR=NAME:op_delete&&VALUE:Delete
Now save the macro and click on play. The macro will now perform the same task of selecting all and deleting but without your interference. It executes the macro 3 times by default but you can run it any number of time specifying a value in the “Max” text box and clicking on Play(Loop). Add 50 and click onPlay(Loop), the process will be repeated 50 times which means that if page has 200 mails then clicking on the Play button would delete 10,000 mails! Thats a lot of mails and the time required to complete the operation wouldn’t be a small one. However, the exact time required to delete 10,000 mails using iMacro automation would vary, depending upon your processor speed and Internet connectivity, but , it can always run in the background.
With a little more effort, iMacro can be configured to automate far more complex operations, but four lines of code to clean a bombed a web mail account is kinda cool.