{"id":3919,"date":"2011-03-07T23:51:44","date_gmt":"2011-03-08T07:51:44","guid":{"rendered":"http:\/\/lee.org\/blog\/?p=3919"},"modified":"2011-05-30T13:55:27","modified_gmt":"2011-05-30T20:55:27","slug":"autohotkey-is-great","status":"publish","type":"post","link":"https:\/\/www.lee.org\/blog\/2011\/03\/07\/autohotkey-is-great\/","title":{"rendered":"Autohotkey is Great"},"content":{"rendered":"<p>I&#8217;ve been using <a href=\"http:\/\/www.autohotkey.com\/\">Autohotkey<\/a> for keyboard macros for a while now. I find it virtually indispensable to work quickly and productively. It rocks.<\/p>\n<p>Here are the most useful macros I use on a regular basis, lifted straight from my AutoHotkey.ahk:<\/p>\n<blockquote><p>; hit ctrl-space to make the current window always on top. From http:\/\/www.labnol.org\/software\/tutorials\/keep-window-always-on-top\/5213\/<br \/>\n^SPACE::  Winset, Alwaysontop, , A<\/p>\n<p>:o:..3::My address<br \/>\n:o:..4::415-&#8230;My phone number<br \/>\n:o:..9::94110<\/p>\n<p>^!r::   ; Run gedit with Ctrl-Alt-r<br \/>\n;IfWinExist, Notepad++<br \/>\n; I found the name of the window by using &#8220;AutoIt3 Window Spy&#8221;, which comes with autohotkey<br \/>\nIfWinExist, ahk_class gdkWindowToplevel<br \/>\nWinActivate<br \/>\nelse<br \/>\nRun, &#8220;C:\\Program Files\\gedit\\bin\\gedit.exe&#8221;<br \/>\nreturn<\/p>\n<p>^!c::   ; Run Calc with Ctrl-Alt-c<br \/>\nIfWinExist, Moffsoft FreeCalc<br \/>\nWinActivate<br \/>\nelse<br \/>\n;\tRun, calc.exe<br \/>\nRun, &#8220;C:\\Program Files\\Moffsoft FreeCalc\\MoffFreeCalc.exe&#8221;<br \/>\nreturn<\/p>\n<p>^!t::   ; Run Truecrypt with Ctrl-Alt-t<br \/>\nIfWinExist, TrueCrypt<br \/>\nWinActivate<br \/>\nelse<br \/>\n;\tRun, calc.exe<br \/>\nRun, &#8220;C:\\Documents and Settings\\Lee\\Desktop\\My Truecrypt file.tc&#8221;<br \/>\nreturn<\/p>\n<p>^!d::   ; Run Chrome with Ctrl-Alt-d<br \/>\nIfWinExist, New Tab &#8211; Google Chrome           ; If there is already a blank window, bring it to front<br \/>\n    {<br \/>\n    WinActivate, New Tab &#8211; Google Chrome<br \/>\n    }<\/p>\n<p>else<br \/>\n    {<br \/>\n    IfWinExist, ahk_class Chrome_WidgetWin_0  ; grab a Chrome window and click ctrl-n to make a new window<br \/>\n        {<br \/>\n        WinActivate<br \/>\n        Send ^n<br \/>\n        }<br \/>\n    }<\/p>\n<p>WinWaitActive, New Tab &#8211; Google Chrome, , 1    ; wait to see if the command worked<\/p>\n<p>IfWinNotExist, New Tab &#8211; Google Chrome        ; if we don&#8217;t have a new chrome window by now (IE, clicking ctrl-n didn&#8217;t work) then <\/p>\n<p>start it manually<br \/>\n\t{<br \/>\n\tRun, &#8220;C:\\Documents and Settings\\Lee\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe&#8221;<br \/>\n\tWinWait, New Tab &#8211; Google Chrome, , 3<br \/>\n\tWinActivate, New Tab &#8211; Google Chrome<br \/>\n\t}<\/p>\n<p>return<\/p>\n<p>^!w::   ; Run Windows Explorer with Ctrl-Alt-w<br \/>\nIfWinExist, My Documents<br \/>\nRun, explorer.exe<br \/>\nelse<br \/>\nRun, explorer.exe<br \/>\nreturn<\/p>\n<p>:o:.address::My full address{enter}San Francisco, CA 94110{enter}<\/p>\n<p>:0:.80::123456789012345678901234567890123456 &gt;40&lt; 3456789012345678901234567890123456 &gt;80{enter}<\/p>\n<p>:o:.&#8211;::{- 50}{down}{home}<br \/>\n:o:.-=::{- 50}{enter}<\/p>\n<p>:o:.=-::{enter}{- 50}{ENTER}{- 50}{down}{home}<br \/>\n:o:.==::{enter}{- 50}{ENTER}{- 50}{enter}<\/p>\n<p>:o:.ms::&#8212;&#8212;&#8211; Original Message &#8212;&#8212;&#8212;&#8212;-{enter}<\/p>\n<p>:o:.me::&#8212;&#8212;&#8211; End of Original Message &#8212;&#8212;{enter}<\/p>\n<p>:o:.ss::&#8212;- Start of Snippet &#8212;-{home}{down}<\/p>\n<p>:o:.se::&#8212;-  End of Snippet  &#8212;-{enter}<\/p>\n<p>:o:.s::San Francisco<br \/>\n:o:.sc::San Francisco, CA<br \/>\n:o:.c:: California<\/p>\n<p>:o:.b::Berkeley<br \/>\n:o:.bc::Berkeley, CA<\/p>\n<p>:o:.date::  ; This hotstring replaces &#8220;]d&#8221; with the current date and time.<br \/>\nFormatTime, CurrentDateTime,, M\/d\/yyyy h:mm tt  ; It will look like 9\/1\/2005 3:53 PM<br \/>\nSetKeyDelay 0  ; This sets the keystrokes below to be sent faster than the default.<br \/>\nSend %CurrentDateTime%<br \/>\nreturn<\/p><\/blockquote>\n<p>To get you excited in case you can&#8217;t read this configuration file, here are some examples:<\/p>\n<blockquote><p>:o:..3::My address<\/p><\/blockquote>\n<p>I type &#8220;..3(Return)&#8221; and it replaces that text with my street address. I use this all the time when buying stuff on websites. Oh, it&#8217;s a &#8220;3&#8221; because my address starts with a 3, making it easy to remember<\/p>\n<blockquote><p>^!d::   ; Run Chrome with Ctrl-Alt-d<br \/>\n&#8230;<\/p><\/blockquote>\n<p>I hit Control-Alt-D and it starts Google Chrome. Or if there is already a blank Chrome window open, it gives it the focus. This is sooo much faster than picking up the mouse and clicking the icon a thousand times a day.<\/p>\n<blockquote><p>^!c::   ; Run Calc with Ctrl-Alt-c<\/p><\/blockquote>\n<p>Pull up the calculator with a quick key combination<\/p>\n<blockquote><p>:o:.ms::&#8212;&#8212;&#8211; Original Message &#8212;&#8212;&#8212;&#8212;-{enter}<\/p><\/blockquote>\n<p>I type &#8220;.ms&#8221; (short for &#8220;message start&#8221;) and it replaces it with, well, I&#8217;ll let you guess. Similarly, &#8220;.me&#8221; is short for &#8220;message end&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using Autohotkey for keyboard macros for a while now. I find it virtually indispensable to work quickly and productively. It rocks. Here are the most useful macros I use on a regular basis, lifted straight from my AutoHotkey.ahk: ; hit ctrl-space to make the current window always on top. From http:\/\/www.labnol.org\/software\/tutorials\/keep-window-always-on-top\/5213\/ ^SPACE:: Winset, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,14],"tags":[],"class_list":["post-3919","post","type-post","status-publish","format-standard","hentry","category-geekery","category-product-recommendations"],"_links":{"self":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/3919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/comments?post=3919"}],"version-history":[{"count":0,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/posts\/3919\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/media?parent=3919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/categories?post=3919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lee.org\/blog\/wp-json\/wp\/v2\/tags?post=3919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}