none of my hotkeys are working. neither the main autohotkey.ahk nor autocorrect.ahk (via an include statement) seems to work. what am i doing wrong? using win 7 enterprise.
i see the following in autohotkey's main window:
001: OutputDebug,Loading autocorrect.ahk...
003: GroupAdd,autoreplaceable,Firefox
004: GroupAdd,autoreplaceable,Notepad
005: GroupAdd,autoreplaceable,Notepad++
006: GroupAdd,autoreplaceable,Lotus Notes
007: GroupAdd,autoreplaceable,Outlook
008: GroupAdd,autoreplaceable,Microsoft Word
009: GroupAdd,autoreplaceable,Google Chrome
010: GroupAdd,autoreplaceable,Opera
011: GroupAdd,autoreplaceable,Internet Explorer
012: GroupAdd,autoreplaceable,ahk_class ATH_Note
013: GroupAdd,autoreplaceable,ahk_class rctrl_renwnd32
014: GroupAdd,autoreplaceable,ahk_class OpusApp
015: GroupAdd,autoreplaceable,ahk_class TfrmBrowserMDIMain.Avant.UnicodeClass
016: GroupAdd,autoreplaceable,ahk_class {1C03B488-D53B-4a81-97F8-754559640193}
017: GroupAdd,autoreplaceable,ahk_class ATL:007C07F0
018: GroupAdd,autoreplaceable,ahk_class gdkWindowToplevel
here's my main autohotkey.ahk...
Code:
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments. They are not executed.
; This script has a special filename and path because it is automatically
; launched when you run the program directly. Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it. You can have as many .ahk
; files as you want, located in any folder. You can also run more than
; one ahk file simultaneously and each will get its own tray icon.
; SAMPLE HOTKEYS: Below are two sample hotkeys. The first is Win+Z and it
; launches a web site in the default browser. The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one). To
; try out these hotkeys, run AutoHotkey again, which will load this file.
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs.
; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks. It also explains more about hotkeys.
#include F:\apps\AutoHotkey\autocorrect.ahk
SetTitleMatchMode 2
OutputDebug, Loading regular ahk...
::#space::Run cmd
#IfWinActive SecureCRT
::2va::cd /var/adm
::.kmip::10.146.2.16
::df::df -k
::ll::ls -alF
::hn::hostname
::zn::zonename
::zlist::zoneadm list -cvi
::hsm::hastatus -sum
::sur::sudo su - root
::.ioe::iostat -En|grep rrors
::.ioef::iostat -En|grep rrors > /tmp/iostat-``hostname``.txt
::.shrtmsgs::tail -10000 /var/adm/messages > /tmp/messages-`hostname`-shrt.txt
::.sndmsgs::scp /var/adm/messages xcxdkuan@10.146.2.16:messages-``hostname``.txt
::.sndioef::scp /tmp/iostat-``hostname``.txt xcxdkuan@10.146.2.16:
::ua::uname -a
::.sz::du -k > /tmp/sizereport.txt
::.rsz::sort -rn /tmp/sizereport.txt > /tmp/sizereportdesc.txt
::.sh::bash{enter}export PS1="\h:\w{#} "
::vmsg::vi /var/adm/messages
::.sndkm::
inputbox,var,Enter filename
sendinput, scp %var% xcxdkuan@10.146.2.16:%var%
return
::.snd::
sendinput, scp
keywait, enter
sendinput ` xcxdkuan@10.146.2.16:
return
#IfWinActive
here's my autocorrect.ahk...
Code:
OutputDebug, Loading autocorrect.ahk...
GroupAdd, autoreplaceable, Firefox
GroupAdd, autoreplaceable, Notepad
GroupAdd, autoreplaceable, Notepad++
GroupAdd, autoreplaceable, Lotus Notes
GroupAdd, autoreplaceable, Outlook
GroupAdd, autoreplaceable, Microsoft Word
GroupAdd, autoreplaceable, Google Chrome
GroupAdd, autoreplaceable, Opera
GroupAdd, autoreplaceable, Internet Explorer
GroupAdd, autoreplaceable, ahk_class ATH_Note ; Windows Mail message
GroupAdd, autoreplaceable, ahk_class rctrl_renwnd32 ; Outlook 2003 email on Vista
GroupAdd, autoreplaceable, ahk_class OpusApp ; Outlook 2003 email on XP
GroupAdd, autoreplaceable, ahk_class TfrmBrowserMDIMain.Avant.UnicodeClass ; Avant Browser
GroupAdd, autoreplaceable, ahk_class {1C03B488-D53B-4a81-97F8-754559640193} ; Apple Safari
GroupAdd, autoreplaceable, ahk_class ATL:007C07F0 ; Yahoo Messenger
GroupAdd, autoreplaceable, ahk_class gdkWindowToplevel ; Pidgin
;-------------------------------------------------------------------------------
; CHANGELOG:
;
; Feb 28, 2007: Added other common misspellings based on MS Word AutoCorrect.
; Added auto-correction of two consecutive capital letters (optional).
; Sep 24, 2006: Initial release.
;
;
; INTRODUCTION
;
; This is an AutoHotKey script that implements AutoCorrect against the Wikipedia
; "Lists of common misspellings":
;
; http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings
;
; I grabbed the machine-readable version which, for some reason I did not
; investigate, is much larger than the combined human-readable lists.
;
; I did tweak the list a bit though:
;
; [1] Some entries have more than one possible resolution. For example:
;
; achive->achieve, archive
;
; For all such cases, I moved them to next-to-last block of words and
; commented them out. You can add these back in as you like, tailored
; to your
; preferences.
;
; [2] I included some of my own personal common typos, also in a block at
; the end.
;
; [3] Incorporated Tara Gibb's suggestion of mapping Win+H to code that will
; allow you to highlight a misspelled word and automatically add its
; corrected value to the end of this script.
;
; Jim Biancolo
; http://www.biancolo.com
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; The following section auto-corrects two consecutive capital letters in a word.
; For example, "WOrd" becomes "Word". It is disabled by default since it might
; cause unwanted corrections such as IfEqual->Ifequal. To enable it, remove
; the /*..*/ symbols from around it.
; This section is from Laszlo's script at http://www.autohotkey.com/forum/topic9689.html
;-------------------------------------------------------------------------------
/*
; The first line of code below is the set of letters, digits, and/or symbols
; that are eligible for this type of correction. Customize if you wish:
keys = abcdefghijklmnopqrstuvwxyz
Loop Parse, keys
HotKey ~+%A_LoopField%, Hoty
Hoty:
CapCount := SubStr(A_PriorHotKey,2,1)="+" && A_TimeSincePriorHotkey<999 ? CapCount+1 : 1
if CapCount = 2
SendInput % "{BS}" . SubStr(A_ThisHotKey,3,1)
else if CapCount = 3
SendInput % "{Left}{BS}+" . SubStr(A_PriorHotKey,3,1) . "{Right}"
Return
*/
;-------------------------------------------------------------------------------
; Win+H to enter misspelling correction. It will be added to this script.
;-------------------------------------------------------------------------------
#h::
; Get the text currently selected. The clipboard is used instead of
; "ControlGet Selected" because it works in a greater variety of editors
; (namely word processors). Save the current clipboard contents to be
; restored later. Although this handles only plain text, it seems better
; than nothing:
AutoTrim Off ; Retain any leading and trailing whitespace on the clipboard.
ClipboardOld = %ClipboardAll%
Clipboard = ; Must start off blank for detection to work.
Send ^c
ClipWait 1
if ErrorLevel ; ClipWait timed out.
return
; Replace CRLF and/or LF with `n for use in a "send-raw" hotstring:
; The same is done for any other characters that might otherwise
; be a problem in raw mode:
StringReplace, Hotstring, Clipboard, ``, ````, All ; Do this replacement first to avoid interfering with the others below.
StringReplace, Hotstring, Hotstring, `r`n, ``r, All ; Using `r works better than `n in MS Word, etc.
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All
Clipboard = %ClipboardOld% ; Restore previous contents of clipboard.
; This will move the InputBox's caret to a more friendly position:
SetTimer, MoveCaret, 10
; Show the InputBox, providing the default hotstring:
InputBox, Hotstring, New Hotstring, Provide the corrected word on the right side. You can also edit the left side if you wish.`n`nExample entry:`n::teh::the,,,,,,,, ::%Hotstring%::%Hotstring%
if ErrorLevel <> 0 ; The user pressed Cancel.
return
; Otherwise, add the hotstring and reload the script:
FileAppend, `n%Hotstring%, %A_ScriptFullPath% ; Put a `n at the beginning in case file lacks a blank line at its end.
Reload
Sleep 200 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
MsgBox, 4,, The hotstring just added appears to be improperly formatted. Would you like to open the script for editing? Note that the bad hotstring is at the bottom of the script.
IfMsgBox, Yes, Edit
return
MoveCaret:
IfWinNotActive, New Hotstring
return
; Otherwise, move the InputBox's insertion point to where the user will type the abbreviation.
Send {HOME}
Loop % StrLen(Hotstring) + 4
SendInput {Right}
SetTimer, MoveCaret, Off
return
#Hotstring R ; Set the default to be "raw mode" (might not actually be relied upon by anything yet).
;-------------------------------------------------------------------------------
; Common Misspellings
;-------------------------------------------------------------------------------
#IfWinActive, ahk_group autoreplaceable
::abandonned::abandoned
::abck::back
::aberation::aberration
::abilties::abilities
::abilty::ability
::abondon::abandon
::abondoned::abandoned
::abondoning::abandoning
::abondons::abandons
#IfWinActive