This started as a version of the 2007 AutoHotkey script, AutoCorrect.ahk, though it has evolved into a package of several interrelated scripts. It is written in AHK v2 code, and so is called "AutoCorrect2." Please note that the .exe files are not compiled versions of the same-named .ahk files. Rather, they are a copies of AutoHotKey.exe that were downloaded from the AutoHotkey site, and renamed, to match the .ahk file. Keeping the two in the same folder allows the user to run the code "portably," right from the folder.
Stephen Kunkel (kunkel321)
- Run: AutoCorrect2\Core\AutoCorrect2.exe
- Then press Win+H
- My apologies to anyone that that has been following the updates today. I've added an Updater tool so folks can "Check for updates" by clicking the button in HotstringHelper's Control Pane. This is my first attempt at making a script that "reaches out" to a website for updates. It seems pretty safe though. Really the only "reaching out" that happens is when the script downloads the latest zip file from github.com. If folks already use GitHub Desktop to manage new versions, then I'd recommend continuing to do so. It probably handles diffing, etc. better.
- More discussion here: https://www.autohotkey.com/boards/viewtopic.php?f=83&t=120220&p=612144#p612144
- You can use your existing HotstringLib.ahk file and log files. Just be sure to put the log files in the AutoCorrect\Data\ folder and the HotstringLib.ahk file in AutoCorrect2\Core. Many of the .ahk files now read from a common .ini file. Because so many of the files have been updated, the rest of the package (other than lib and logs) should probably be replaced.
It's worth noting that only one other person -- Robert -- has contributed code via the GitHub push mechanism, but many others have made significant contributions by other means (usually the AutoHotkey forums). I'll list them here eventually, but they can also be found in the code comments of the various ahk files in the repository.
- The Options Box. Hotstring options go here.
- The Hotstring (Trigger string) Box. Upon pressing the hotkey, this box gets populated with the word on the clipboard. If many words are on the clipboard, an acronym is generated. If the Exam Pane is open, adding a letter to the beginning or end of the trigger will cause the same letter to be automatically added to the replacement text. Shift+Left focuses the Trigger Box. Ctrl-Up/Down or Ctrl-Mouse Wheel toggles font size.
- If the string in the Trigger Box corresponds to any English words, it will turn red and warn you.
- On-board help system. Also press F1 while any form element is selected.
- The Make Bigger toggle button makes the Replacement Box much larger.
- The Show Symbols toggle button makes the Replacement Box read only and shows characters for new lines, tabs, and spaces.
- The Replacement Box. For autocorrects, this will likely be a single word. For boilerplate templates, it might be a whole paragraph.
- The Make Function checkbox instructs hh2 to create the autocorrect item with the auto-logging function syntax, such as :B0X*:automasion::f("automation")
- Note that boilerplate items are never created with function calls.
- The Comments Box. Text entered here is added to the new hotstring as an inline comment.
- The Append Button combines the content of the boxes into a hotstring and (after doing a validity check) appends it to the Hotstring Library, then restarts the AutoCorrect script. Pressing Enter does this too, but only if the replacement box is not active. The Append Button has no effect when in Show Symbols mode.
- Shift-Click sends the hotstring to the clipboard, rather than appending it.
- Ctrl-Click appends the hotstring, but does not restart the script.
- Alt-Click sends the hotstring to the Suggester Tool for analysis.
- The Check Button does a validity check but does not append the item. Mostly this consists of ensuring that the new hotstring doesn’t conflict with any existing ones.
- The Exam Button opens the Exam Pane (as seen in the image). When the Pane is open, the button shows “Done.” Right-Click, or Shift-Click will open a Control Panel, which has several links to other tools.
- The Spell Button sends the content of the Replacement Box to LanguageTool.org’s API and returns spelling and/or grammar suggestions.
- If a word from the Replacement, Misspells, or Fixes box is selected, the Look Button will search the on-board WordNet dictionary for a definition. Right-click uses the online GCIDE dictionary.
- Cancel hides the hh2 form and puts the previous content of the clipboard back. Esc does the same thing. (Note that the following items are part of the Exam Pane and are only for refining autocorrect entries. They are not useful for boilerplate template hotstrings.)
- The tall Left-Trim Button simultaneously trims a single letter from the beginning of the trigger string and the replacement string.
- The tall Right-Trim Button trims a letter from the ends.
- The wide Undo button will undo the trims. Ctrl-z also does. Shift-Click or Shift-Ctrl-z will undo all trims, resetting the originally-captured trigger and replacement.
- The Delta String shows which parts of the autocorrect entry get changed, and which parts can safely be trimmed.
- The Radio Buttons set the hotstring as a word-beginning, word-ending, or word-middle item. The Options Box is automatically updated to match. Right-Click any item to unselect all of them.
- Web Frequencies are the sum of the number of times the words in the Misspells or Fixes lists occur on the internet. This helps to see if the words are common English words or if they are obscure. The Fixes [] and Misspells [] just shows the number of items in each list.
- The Misspells Box lists all of the English words that correspond to the text string in the Trigger Box and hence would be misspelled from the use of the autocorrection item as it is.
- The Fixes Box is a list of the words that can potentially be fixed by the current autocorrect item. Trimming, or changing the radios, will change the number of Misspells and Fixes.
Please see the User Manual for more information. https://github.com/kunkel321/AutoCorrect2/tree/main/Documentation
- The files in the sub folders all use relative folder paths, so you should be able to unzip the AutoCorrect2.zip and put the folder anywhere. Note however, that the desktop.ini that Windows uses for the custom icon location has to be an absolute path. Mine is "C:\Users\steve\OneDrive\Documents\GitHub\AutoCorrect2\Resources\Icons\AhkBluePsicon.ico". You should change that to the path on your own computer.
