<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>ArunRocks &#187; productivity</title>
	<atom:link href="http://www.arunrocks.com/blog/archives/category/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arunrocks.com/blog</link>
	<description>Representing Anti-Monotonistic Tendencies</description>
	<pubDate>Sat, 22 Nov 2008 05:49:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Forget Pages with Autopagerize</title>
		<link>http://www.arunrocks.com/blog/archives/2008/11/17/forget-pages-with-autopagerize/</link>
		<comments>http://www.arunrocks.com/blog/archives/2008/11/17/forget-pages-with-autopagerize/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 18:49:57 +0000</pubDate>
		<dc:creator>Arun bhai</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Technical]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.arunrocks.com/blog/?p=136</guid>
		<description><![CDATA[     <link rel="alternate" type="application/atom+xml" title="ArunRocks Category: General" href="http://www.arunrocks.com/blog/archives/category/general/feed/" />
     <link rel="alternate" type="application/atom+xml" title="ArunRocks Category: Technical" href="http://www.arunrocks.com/blog/archives/category/technical/feed/" />
     <link rel="alternate" type="application/atom+xml" title="ArunRocks Category: firefox" href="http://www.arunrocks.com/blog/archives/category/firefox/feed/" />
     <link rel="alternate" type="application/atom+xml" title="ArunRocks Category: greasemonkey" href="http://www.arunrocks.com/blog/archives/category/greasemonkey/feed/" />
     <link rel="alternate" type="application/atom+xml" title="ArunRocks Category: productivity" href="http://www.arunrocks.com/blog/archives/category/productivity/feed/" />
Reddit had a heated debate about the AJAX paging pattern. The debate sidetracked into the benefits of Paging. Nobody seemed to mention the excellent greasemonkey script Autopagerize which is proof that the concept works brilliantly. I find it one of the most indispensable Greasemonkey scripts available today.
The idea is simple. Assume you are reading a [...]]]></description>
			<content:encoded><![CDATA[<p>Reddit had a heated debate about the <a href="http://looksgoodworkswell.blogspot.com/2005/06/death-to-paging-rico-livegrid-released.html">AJAX paging pattern</a>. The debate sidetracked into the benefits of Paging. Nobody seemed to mention the excellent greasemonkey script <a href="http://userscripts.org/scripts/show/8551">Autopagerize</a> which is proof that the concept works brilliantly. I find it one of the most indispensable Greasemonkey scripts available today.</p>
<p>The idea is simple. Assume you are reading a blog in blogspot.com. When you scroll towards the end of the blog, Autopagerize realizes that you are really interested in reading more blog posts. In other words, soon you would click on &#8216;Older Entries&#8217; links. This would have caused a fresh page to load. How terribly annoying! Instead, Autopagerize will silently load the older posts in the background and seamlessly add them to the end of the page. By the time you finish reading the second page, the third page will be added to the end and so on and so forth. This results in a smooth and breezy browsing experience, which has to be experienced to be believed.</p>
<h3>Installing Autopagerize</h3>
<p><a href="http://userscripts.org/scripts/show/8551">Autopagerize</a> uses greasemonkey plugin and hence works only if you have Firefox installed. The steps are quite simple:</p>
<ol>
<li>Install <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a></li>
<li>Go to <a href="http://userscripts.org/scripts/show/8551">Autopagerize script</a> page and click on &#8216;Install this Script&#8217; button</li>
<li>Visit any of the supported sites e.g. <a href="http://stackoverflow.com/questions/tagged/python">stackoverflow.com</a> or a blog like <a href="http://userscripts.org/scripts/show/8551">simblog</a></li>
<li>If the page supports Autopagerize, a green square will appear at the top right of the page. Scroll to the end and it will momentarily turn blue to indicate that the next page is loading in the background.</li>
</ol>
<p><img src="/blog/wp-content/photos/autopager/00-autopagerize.png" alt="Autopagerize in action" /></p>
<h3>How does Autopagerize work?</h3>
<p>Autopagerize works on all kinds of sites which have pages. But how does it manage to understand the structure of them all? The answer is the community maintained SITEINFO database which is the result of hundreds of hours of effort.</p>
<p>Autopagerize is turned on for a particular site if its URL matches the <strong>url</strong> property. Once the page is loaded, it searches for the next link based on the xpath provided by <strong>nextLink</strong> property. The next page&#8217;s content is identified by the <strong>pageElement</strong> property. Anything which is not part of this content is discarded. This content is then appended to the existing page either by appending as a sibling to the existing <strong>pageElement</strong> or if <strong>insertBefore</strong> is defined, it is inserted before the element identified by  <strong>insertBefore</strong> property. </p>
<h3>How to Add any Website to Autopagerize?</h3>
<p><em>Note: This is not for the faint of heart. It involves opening and working with some code (to the extend of editing some regular expressions).</em></p>
<p>So you would like extend the Autopagerize experience to more and more sites? Don&#8217;t worry, you have come to the right place. For this section you would need to install the excellent Firebug plugin. Firebug&#8217;s javascript console is the best interactive XPath debugger I am aware of.</p>
<p><span id="more-136"></span></p>
<p>First, ensure that Firebug console is activated for your site. Visit the page you would like to Autopagerize say <a href="http://www.adobetutorialz.com/articles/2751/1/Professional-Web-Layout-for-Business-Solutions">http://www.adobetutorialz.com/articles/2751/1/Professional-Web-Layout-for-Business-Solutions</a>. Click on the firebug icon and enable the Console by checking the first check box (as shown in the figure). Click on Enable. Now the page gets refreshed and the Console appears.</p>
<p><img src="/blog/wp-content/photos/autopager/01-firebug-console.png" alt="Firebug Console" /></p>
<p>Next, go to the Firefox menu item: Tools -> Greasemonkey -> Manage User Scripts. Select Autopagerize from the list and click on Edit button below. </p>
<p><img src="/blog/wp-content/photos/autopager/02-greasemonkey-dialog.png" alt="Greasemonkey Option" /></p>
<p>Turn on debugging by changing line 26 (could be different for you) to <code>var DEBUG = 1</code>. However I could make debugging work only after adding the following 3 lines further down, say after line 85.</p>
<pre><code>if(unsafeWindow.console){
   var GM_log = unsafeWindow.console.log;
}
</code></pre>
<p>Scroll to the line that starts with <code>var SITEINFO = [</code>, which is around line 40. Copy and uncomment the 6 lines of sample code provided by the author as shown in the figure.</p>
<p><img src="/blog/wp-content/photos/autopager/03-emacs-screen.png" alt="Editing code in Emacs" /></p>
<p>Now, give the appropriate XPATH values to the property variables &#8220;pageElement&#8221; and &#8220;nextLink&#8221;. The &#8220;url&#8221; variable is a simple regular expression and an example link for the fourth variable (this variable is purely for documentation). Save this file and refresh your page. If the XPATH values are correctly found the Autopagerize green square icon will appear on the page, else there will be some error on your Firebug console like:</p>
<pre><code>nextLink not found
</code></pre>
<h3>Debugging Autopagerize or Shit, Nothing Happens!</h3>
<p>As you might have guessed, the last step I mentioned earlier is not so easy. This is where Firebug can help you. Before you start read some <a href="http://www.w3schools.com/Xpath/">XPATH tutorials</a> on the net to familiarize yourself with the XPATH syntax. </p>
<p>One killer feature in Firebug is selecting any element of a page and copying the XPath value of that element. On the Firebug window click on Firebug&#8217;s Inspect button and mousing over the page to outline that page element (see fig). </p>
<p><img src="/blog/wp-content/photos/autopager/04-inspect.png" alt="Firebug Inspect" /></p>
<p>Click on the page element you are interested in and the details of the element appear on the firebug window. Right clicking on any item in the breadcrumb at the very top, you will see a Copy XPath option (see fig). </p>
<p><img src="/blog/wp-content/photos/autopager/05-copy-xpath.png" alt="Copying XPATH" /></p>
<p>Now go to the console tab of Firebug and test the XPath by using the $x function. Paste the XPath as an argument to this function and you should get an HTMLElement as the result (see fig).</p>
<p><img src="/blog/wp-content/photos/autopager/06-firebug.png" alt="Paste to Console" /></p>
<p>You will need to find variables: &#8220;pageElement&#8221; and &#8220;nextLink&#8221; this way. This is not an exact science and involves a lot of trial and error. Here are some tips I found after several hours of testing:</p>
<ol>
<li><strong>Escaping</strong> - You will need to add a backslash &#8216;\&#8217; before each special character like &#8216;/&#8217; or &#8220;. This is not required in the Firebug console, however.</li>
<li><strong>Single Quotes</strong> - It is best to use single-quotes as the outer-most quotes in the Firebug console</li>
<li><strong>Firebug gives Absolute Paths</strong> - You will find that Firebug gives XPaths based on the position of a child element, which is likely to break even if the smallest change is made to the page. Try to avoid relying on positions.</li>
<li><strong>Use attributes</strong> - The best XPaths use the classname property or id property of an element or its parent.</li>
<li><strong>No Array Results</strong> - The XPath must always return a unique element. If an array of elements are returned, it will not work.</li>
<li><strong>Watch the Console</strong> - After you enable debugging the console provides useful error messages. This helps in identifying the problem.</li>
<li><strong>Read Examples</strong> - It is always best to check the huge <a href="http://wedata.net/databases/AutoPagerize/items.json">SITEINFO database</a> to understand how other users have tackled similar or tricky sites.</li>
</ol>
<p>For the site we were using as an example, the following code should work:</p>
<div>
<textarea name="code" class="JScript:nogutter" cols="60" rows="10">
   {
      pageElement: "\/\/table[contains(@class,\"ViewArticlePanel\")]",
      url: "^http:\/\/www\\.adobetutorialz\\.com\/articles",
      nextLink: "\/\/div[@class=\"ArticleNavigation\"]\/a[contains(text(),\"Next »\")]",
      exampleUrl: "http://www.adobetutorialz.com/articles/2751/1/Professional-Web-Layout-for-Business-Solutions"
    },

    </textarea>
</div>
<p>Hope this gives you enough information on Autopagerize and improves your browsing experience!</p>
<div class="socm_link">
<p class="bookm_links"> Bookmark this to      <a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;title=Forget+Pages+with+Autopagerize" id="socialm_del.icio.us" title="Submit this post to del.icio.us">del.icio.us</a> |       <a href="http://digg.com/submit?phase=2&#038;url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;title=Forget+Pages+with+Autopagerize" id="socialm_Digg" title="Submit this post to Digg">Digg</a> |       <a href="http://furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;t=Forget+Pages+with+Autopagerize" id="socialm_Furl" title="Submit this post to Furl">Furl</a> |       <a href=" http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;T=Forget+Pages+with+Autopagerize" id="socialm_Netscape" title="Submit this post to Netscape">Netscape</a> |       <a href="  http://www.google.com/bookmarks/mark?op=edit&#038;bkmk=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;title=Forget+Pages+with+Autopagerize" id="socialm_Google Bookmarks" title="Submit this post to Google Bookmarks">Google Bookmarks</a> |       <a href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F" id="socialm_Technorati" title="Submit this post to Technorati">Technorati</a> |       <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F11%2F17%2Fforget-pages-with-autopagerize%2F&#038;title=Forget+Pages+with+Autopagerize" id="socialm_reddit" title="Submit this post to reddit">reddit</a> |  </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.arunrocks.com/blog/archives/2008/11/17/forget-pages-with-autopagerize/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Hindu Online Made Better with Greasemonkey</title>
		<link>http://www.arunrocks.com/blog/archives/2008/07/19/reading-hindu-online-made-better-with-greasemonkey/</link>
		<comments>http://www.arunrocks.com/blog/archives/2008/07/19/reading-hindu-online-made-better-with-greasemonkey/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 11:18:30 +0000</pubDate>
		<dc:creator>Arun bhai</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.arunrocks.com/blog/?p=131</guid>
		<description><![CDATA[Note this currently works only if you have Firefox installed
The Hindu is is one of the newspapers I have great respect for. I am allergetic to fresh newsprint, so I have no choice but to read their online edition even if I have subscribed to the print edition. But their website badly needs a redesign. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note this currently works only if you have Firefox installed</strong></p>
<p><a href="http://www.thehindu.com/">The Hindu</a> is is one of the newspapers I have great respect for. I am allergetic to fresh newsprint, so I have no choice but to read their online edition even if I have subscribed to the print edition. But their website badly needs a redesign. However, in this Web2.0 era you are not at the mercy of the site admins to do something about it. <em>You</em> can improve your browsing experience in 2 steps:</p>
<ol>
<li>
<p>Point your firefox to the <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey add-on</a> page and install the add-on. Now restart Firefox before you go to step 2. Don&#8217;t worry all your open tabs will be restored.</p>
</li>
<li>
<p>Go to the <a href="http://userscripts.org/scripts/show/30273">Hindu Printer Redirect Script</a> and click on the <strong>Install this Script</strong> button</p>
</li>
</ol>
<p>Voila, start browsing Hindu, for example <a href="http://www.hindu.com/2008/07/19/01hdline.htm">this page</a> and enjoy the difference!</p>
<div class="socm_link">
<p class="bookm_links"> Bookmark this to      <a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;title=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_del.icio.us" title="Submit this post to del.icio.us">del.icio.us</a> |       <a href="http://digg.com/submit?phase=2&#038;url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;title=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_Digg" title="Submit this post to Digg">Digg</a> |       <a href="http://furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;t=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_Furl" title="Submit this post to Furl">Furl</a> |       <a href=" http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;T=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_Netscape" title="Submit this post to Netscape">Netscape</a> |       <a href="  http://www.google.com/bookmarks/mark?op=edit&#038;bkmk=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;title=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_Google Bookmarks" title="Submit this post to Google Bookmarks">Google Bookmarks</a> |       <a href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F" id="socialm_Technorati" title="Submit this post to Technorati">Technorati</a> |       <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F07%2F19%2Freading-hindu-online-made-better-with-greasemonkey%2F&#038;title=Reading+Hindu+Online+Made+Better+with+Greasemonkey" id="socialm_reddit" title="Submit this post to reddit">reddit</a> |  </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.arunrocks.com/blog/archives/2008/07/19/reading-hindu-online-made-better-with-greasemonkey/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy Organised 2008</title>
		<link>http://www.arunrocks.com/blog/archives/2008/01/08/happy-organised-2008/</link>
		<comments>http://www.arunrocks.com/blog/archives/2008/01/08/happy-organised-2008/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 06:24:22 +0000</pubDate>
		<dc:creator>Arun bhai</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Pocketmod]]></category>

		<category><![CDATA[emacs]]></category>

		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.arunrocks.com/blog/archives/2008/01/08/happy-organised-2008/</guid>
		<description><![CDATA[The first New Year after marriage is always special.  It will be a lot quieter (and sober?) than one&#8217;s earlier outings. In Mangalore, most of the discs were either overcrowded (Zero Degrees?) or charging like hell (GoldFinch?). So we decided to go to Palki and have a nice buffet at the rooftop. What we [...]]]></description>
			<content:encoded><![CDATA[<p>The first New Year after marriage is always special.  It will be a lot quieter (and sober?) than one&#8217;s earlier outings. In Mangalore, most of the discs were either overcrowded (Zero Degrees?) or charging like hell (GoldFinch?). So we decided to go to Palki and have a nice buffet at the rooftop. What we didn&#8217;t know was that it offered an amazingly close view of the fireworks in the surrounding area. It was a great way to start the new year.</p>
<p><img src="http://farm1.static.flickr.com/193/472855937_3086ea8513.jpg" alt="Beginnings"/></p>
<p>Speaking of starts, for most of us January 1st is like a reset button. Or at least we wish it is. Here comes an opportunity to cut down on that chocolate addition or make a habit of paying bills on<br />
time. They go by the ominous term &#8216;Resolutions&#8217;. For me, a self described procrastinator, I had to bring to speed my time planning tools to the brand new 2008. In case you are wondering, they are:</p>
<ul>
<li><a href="http://www.pocketmod.com/">Hipster PDA/PocketMod</a></li>
<li>My customised-till-my-fingers-bled <a href="http://ntemacs.sourceforge.net/">Emacs 23.0</a> </li>
</ul>
<p>I printed out my Pocketmod from the website directly. I was using version 2 for the first time and loved the idea of being able to customize the front page with my details. You can have print your name and address printed rather than typing it each time.</p>
<p><img src="http://farm1.static.flickr.com/56/134447135_e3cb18933f_m.jpg" alt="Sorry! couldn't get a photo for 2008" class="alignright" /></p>
<p>I&#8217;ve been reconverted to emacs from <a href="notepad-plus.sourceforge.net/">Notepad++</a>, after seeing the very useful <a href="http://orgmode.org/">Org</a> mode. Once again I have spent many, many hours cutomising the my .emacs file. When it comes to emacs the word customising is really misleading, it should be actually called reprogramming <img src='http://www.arunrocks.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img src="http://farm3.static.flickr.com/2064/2177456672_cf1ed8622e_m.jpg" alt="My Current Emacs Screen" class="alignleft" /></p>
<p>Actually, this time I have added some very neat features like TextMate-like snippet expansion upon pressing TAB, personal menu, windows Postscript printer support (Emacs prepares gorgeous printouts of code). They are very useful and I hope I will be able to blog about them soon. In fact, this post was written in Emacs using a <a href="http://jblevins.org/projects/markdown-mode/">markdown</a> mode</p>
<p>So for all my readers out there here is wishing you and happy, prosperous and well-planned New Year!<!--30084625e410a948e1bb61d2505e4dab--></p>
<div class="socm_link">
<p class="bookm_links"> Bookmark this to      <a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;title=Happy+Organised+2008" id="socialm_del.icio.us" title="Submit this post to del.icio.us">del.icio.us</a> |       <a href="http://digg.com/submit?phase=2&#038;url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;title=Happy+Organised+2008" id="socialm_Digg" title="Submit this post to Digg">Digg</a> |       <a href="http://furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;t=Happy+Organised+2008" id="socialm_Furl" title="Submit this post to Furl">Furl</a> |       <a href=" http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;T=Happy+Organised+2008" id="socialm_Netscape" title="Submit this post to Netscape">Netscape</a> |       <a href="  http://www.google.com/bookmarks/mark?op=edit&#038;bkmk=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;title=Happy+Organised+2008" id="socialm_Google Bookmarks" title="Submit this post to Google Bookmarks">Google Bookmarks</a> |       <a href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F" id="socialm_Technorati" title="Submit this post to Technorati">Technorati</a> |       <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2008%2F01%2F08%2Fhappy-organised-2008%2F&#038;title=Happy+Organised+2008" id="socialm_reddit" title="Submit this post to reddit">reddit</a> |  </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.arunrocks.com/blog/archives/2008/01/08/happy-organised-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Work Faster in Windows With Launchy and a few Python Scripts</title>
		<link>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/</link>
		<comments>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 05:39:23 +0000</pubDate>
		<dc:creator>Arun bhai</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[launchy]]></category>

		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/</guid>
		<description><![CDATA[
Launchy is a great productivity tool and a cool way to impress your friends. You can launch any application by pressing a hotkey (say Alt+Space) and the first few letters of the application for eg: typing &#8216;gi&#8217; will display the GIMP icon and pressing Enter will launch GIMP. You can download Launchy from its website [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/133/414218839_e89ef7791d_m_d.jpg" width="240" height="160" alt="Eating the Mouse" class="alignright" /></p>
<p><a href="http://www.launchy.net/">Launchy</a> is a great productivity tool and a cool way to impress your friends. You can launch any application by pressing a hotkey (say Alt+Space) and the first few letters of the application for eg: typing &#8216;gi&#8217; will display the GIMP icon and pressing Enter will launch GIMP. You can <a href="http://downloads.sourceforge.net/launchy/LaunchySetup125.exe?modtime=1177060449&amp;big_mirror=0">download Launchy</a> from its website and its <a href="http://www.launchy.net/LaunchySetup199_1.exe">beta</a> is pretty stable (and gorgeous) on my XP laptop too.</p>
<p>Using Launchy gets pretty addictive and soon you will hate using the Start menu or even Explorer on Windows for opening applications or files. So I took the red pill and started automating the following things with a little help from Python:</p>
<ul>
<li>Launching Intranet applications inside Internet Explorer (even if Firefox is your default browser)</li>
<li>Bringing minimized or overlapped windows to the foreground</li>
</ul>
<h3>Some Necessary Evil</h3>
<p>Don&#8217;t get me wrong, I hate IE as much as you do. But the fact of life is that many web apps out there &#8220;Work best when viewed in IE&#8221; (TM). Even if you have launchy plugins to launch the web app, if your default browser is Firefox, it might show incorrectly. Here is the solution:</p>
<ol>
<li>Install <a href="http://www.python.org/download/releases/">Python</a> and <a href="http://sourceforge.net/project/platformdownload.php?group_id=78018<!--a356f40d910087cee9142fddb0a224fb--><!--e9c7a4b871b077caf3e685ae3481471e--">Pywin32</a></li>
<li>Copy the following script to the Utilities directory (it will be in the path where you installed Launchy) and save it with a <strong>.pyw</strong> extension not a <strong>.py</strong> extension</li>
</ol>
<div>
<textarea name="code" class="python:nogutter" cols="60" rows="10">
    from win32com.client import Dispatch
    ie = Dispatch("InternetExplorer.Application")
    ie.Visible = True
    ie.Navigate(r"http://intranetapp/home")
    </textarea>
</div>
<p>In the above code replace the URL <strong>http://intranetapp/home</strong> with the URL of your choice.</p>
<p>Finally, open Launchy, right-click and say &#8216;Rebuild Index&#8217;.</p>
<h3>No more Alt-Tabbing around</h3>
<p>If you are like me, you&#8217;ll have a lot of windows open at the same time. I have tried increasing the task bar height and grouping similar windows feature in XP to manage them. But I always wish I could invoke commonly used open applications like my chat window in just a few keystrokes. Launchy doesn&#8217;t index open programs by default, but with some python magic I can show you how to bring some commonly used windows to the foreground:</p>
<ol>
<li>As before, install <a href="http://www.python.org/download/releases/">Python</a> and <a href="http://sourceforge.net/project/platformdownload.php?group_id=78018<!--a356f40d910087cee9142fddb0a224fb--><!--e9c7a4b871b077caf3e685ae3481471e--">Pywin32</a></li>
<li>Copy the following script to the Utilities directory (it will be in the path where you installed Launchy) and save it with a <strong>.pyw</strong> extension not a <strong>.py</strong> extension</li>
</ol>
<div>
<textarea name="code" class="python:nogutter" cols="60" rows="10">
    import sys
    from win32gui import GetWindowText, EnumWindows, ShowWindow, SetForegroundWindow 
    from win32con import SW_RESTORE, SW_SHOW 

    TITLE_MATCH = "Microsoft Excel - Expenses.xls"

    def listWindowsHandles():
        res = []
        def callback(hwnd, arg):
            res.append(hwnd)
        EnumWindows(callback, 0)
        return res

    def listWindowsNamesAndHnd():
        return [(hwnd, GetWindowText(hwnd)) for hwnd in listWindowsHandles()]

    def unminimizeWindow(a_hwnd):
        ShowWindow(a_hwnd, SW_RESTORE)
        SetForegroundWindow(a_hwnd)

    def finder1():
        for hwnd, title in listWindowsNamesAndHnd(): 
            if TITLE_MATCH in title: 
                unminimizeWindow(hwnd)

    finder1()
    </textarea>
</div>
<p>In the above code change the string <strong>Microsoft Excel - Expenses.xls</strong> with the title the window you would like to summon.</p>
<p>Finally, open Launchy, right-click and say &#8216;Rebuild Index&#8217;.</p>
<p>This works even if the window was minimized.</p>
<p>I hope, finally you can throw your mouse away. Ah&#8230; What a bliss!</p>
<div class="socm_link">
<p class="bookm_links"> Bookmark this to      <a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;title=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_del.icio.us" title="Submit this post to del.icio.us">del.icio.us</a> |       <a href="http://digg.com/submit?phase=2&#038;url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;title=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_Digg" title="Submit this post to Digg">Digg</a> |       <a href="http://furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;t=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_Furl" title="Submit this post to Furl">Furl</a> |       <a href=" http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;T=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_Netscape" title="Submit this post to Netscape">Netscape</a> |       <a href="  http://www.google.com/bookmarks/mark?op=edit&#038;bkmk=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;title=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_Google Bookmarks" title="Submit this post to Google Bookmarks">Google Bookmarks</a> |       <a href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F" id="socialm_Technorati" title="Submit this post to Technorati">Technorati</a> |       <a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.arunrocks.com%2Fblog%2Farchives%2F2007%2F12%2F04%2Fwork-faster-in-windows-with-launchy-and-a-few-python-scripts%2F&#038;title=Work+Faster+in+Windows+With+Launchy+and+a+few+Python+Scripts" id="socialm_reddit" title="Submit this post to reddit">reddit</a> |  </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
