AutoHotKeys

From 43FoldersWiki

Jump to: navigation, search

Like ActiveWords, allows for text replacement in virtually any and all Windows applications, as well as setting up hot keys and scripting all kinds of other activities.

AutoHotKey is particularly useful because it allows for really advanced scripting. It also has a "button code detector", so if you have one of those random multimedia keyboards with lots of different "multimedia" buttons, you can fairly easily find out what code they're sending and therefore modify them to do whatever you want.


Jealous of the Quicksilver Append-to-text Feature? Here's a little AutoHotkey script I use to append a single line of my "inbox" plain text file. You'll need to cusomize it to suit your text setup. In my case, my inbox file is G:\GTD\Inbox. I often have all my plain-text organizing files open in an UltraEdit "project," so I check to see if it is open there before I get myself into a race condition. To run it, I press winkey-I (The line that begins #i says to run AddToInbox when winkey-i is pressed).

#SingleInstance force
#Persistent 
#i::AddToInbox()
;**********************************************************************************
AddToInbox()
{
  InputBox, aLine, "Add to Inbox", "Enter a line to add to my In-box"
  if ErrorLevel <> 0
    return
  SetTitleMatchMode, 3		; 1=starts-with, 2=contains, 3=exact-match-full-title
  IfWinExist, Inbox - Notepad
    {
    WinActivate
    Send, ^{END}
    Send, %aLine%
    Send, {ENTER}
    return
    }
  SetTitleMatchMode, 3		; 1=starts-with, 2=contains, 3=exact-match-full-title
  IfWinExist, UltraEdit-32 - PIM - G:\GTD\Inbox
    {
    WinActivate
    Send, ^{END}
    Send, %aLine%
    Send, {ENTER}
    return
    }
  SetTitleMatchMode, 1		; 1=starts-with, 2=contains, 3=exact-match-full-title
  IfWinExist, UltraEdit-32 - PIM
    {
    WinActivate
    WinGetActiveTitle, SaveTitle
    Loop
      {
      Send, ^{TAB}
      WinGetActiveTitle, TheTitle
      if TheTitle = %SaveTitle%
        break
      if TheTitle = UltraEdit-32 - PIM - G:\GTD\Inbox
        {
        Send, ^{END}
        Send, %aLine%
        Send, {ENTER}
        return
        }
      }
    }  
  Run, notepad.exe g:\gtd\Inbox
  Sleep, 250
  WinActivate, Inbox - Notepad
  SetTitleMatchMode, 3		; 1=starts-with, 2=contains, 3=exact-match-full-title
  ifWinNotActive, Inbox - Notepad
    {
    msgbox, Where is my notepad?
    return
    }
  Send, ^{END}
  Send, %aLine%
  Send, {ENTER}
  Send, ^s
  Send, !fx
  return
}

http://www.autohotkey.com/

Personal tools