Why AutoHotkey for Poets?

Erstwhile Multifarious Poets Optated for Quill and Parchment. Forthwith, AutoHotkey Propounds the Furtherance of Lyrical Ruminations on Windows Computers.

Okay…I’m not a poet. My mind doesn’t work that way. But that doesn’t mean I can’t see how AutoHotkey might be useful to people who craft the English (or any other) language. Even so, I robotpoetryoccasionally enjoy writing a short rhyming couplet. (I know…constructing rhyming poems has become cliché—at least for real poets.)

In this blog, I offer a couple of AutoHotkey scripts for assisting and inspiring(?) budding wordsmiths. The first includes a set of over 500 Hotstrings for inserting “the most beautiful words in the English language.” The second script draws upon the Web to create a pop-up menu of rhymes. Even if you never intend to write a poem, you might find these AutoHotkey techniques interesting and/or useful.

Beautiful Hotstrings

After discovering a list of the “117 most beautiful words in the English language” I put together a script with over 500 Hotstring replacements. I thought that poets might want to automatically replace some of the more mundane words with eloquent substitutions. After all, poetry is the art of bringing out the elegance of words in both speech and writing. Upon loading these Hotstring, AutoHotkey replaces any word found in the common list with the theoretically more beautiful alternative. A sample of the Hotstrings follows:


Each Hotkey line of code in this PoeticWords.ahk script acts as an independent command. Once (erstwhile?) loaded, whenever you type the first word (located between the two sets of double colons) followed by keying any standard punctuation or space, AutoHotkey deletes that word and replaces it with the last text (located after the second set of double colons). To add more Hotkeys, simply insert another line using the same format.

Warning (harbinger?): Don’t leave these AutoHotkey Hotstrings loaded when writing comments on Facebook…unless you want to appear pretentious.

AutoHotkey Library Deal
AutoHotkey Library Deal

*          *          *

If AutoHotkey (or any type of script writing) looks like a foreign language, then check out this “Introduction to AutoHotkey: A Review and Guide for Beginners” page.

*          *          *

The AutoHotkey Hotstring feature is an important (quintessential?) technique for building writing and editing apps. One popular AutoHotkey script corrects (on the fly) commonly misspelled words in any Windows document or editing field. You can adapt these text expansion/replacement capabilities in any manner that suits your personal needs. In the book Beginning AutoHotkey Hotstrings, I offer examples for automatically expanding abbreviations into their full definition, as well as, show how to insert boilerplate text. I even wrote a short script for popping up a menu of substitutes for overused words found in school term papers.

This PoeticWords.ahk script works best as a tool for alternative word exploration rather than an app for automatic loading on your PC. The “beautiful” replacement words may pop-up at unexpected times. Plus, the meaning of the new (incipient?) words may not quite coincide with the original term. However, the surprising substitute may inspire further digging into its appropriateness. If the alternative doesn’t work, then in most Windows programs pressing CTRL+Z removes it. (Click the mouse button before finishing the word to disable any Hotstring about to activate.) If the script becomes an annoyance, simply right-click on its icon in the Windows System Tray and click Exit.

The key for poets is adapting the Windows AutoHotkey tools for creative purposes. I left out a few of the “beautiful word” suggestions since I couldn’t see any obvious replacements. I also added a few of my own. No doubt any poet would want to include their own favorites. (Okay, maybe you don’t need to write a poem, but you can always make your messages and e-mails more ostentatious by running this app.)

If I taught a class in writing poetry (as if I would qualify), I might write an app similar to the overused words script mentioned above for suggesting “beautiful words” to students while they write. It would take some time to assemble the word lists, but the script could then be compiled into an EXE file which runs on any Windows computer. Then, the student could use the app without even loading the main AutoHotkey program.

Rhymes from the Web

After highlighting the word “house” and using the Hotkey combination CTRL+ALT+R, a menu pops up displaying a list of possible rhymes. Click a word and it replaces the originally highlighted word.

In these times, I don’t know how many (a plethora?) poets look for rhyming words. It seems that, with the exception (elision?) of limericks, rhymes may have gone out of fashion. However, for beginning (incipient?) lyricists, a method for locating similar sounding words might make the job a little easier.

The Web acts as a tremendous source of free information. Normally, we access it by loading a Web browser and navigating to (or searching for) a specific page. A number of Web pages offer rhymes. With AutoHotkey, we can bypass the Web browser and directly load the alternative rhymes from the Web page into a pop-up menu. Select the word from the menu, then AutoHotkey inserts it into the document.

This RhymeMenu.ahk script helped me write the following poem:

As I sat in my house,
    Looking at a mouse,
I found that the louse
    Was eating my blouse!

(I don’t actually own a blouse, but I took poetic license. After hearing the poem, my granddaughter smiled, “That’s silly!”)

Admittedly, RhymeMenu.ahk is not a beginning (incipient?) level script. Therefore, I do not offer a detailed discussion of the code here. However, I have embedded comments in the AHK file which highlight how it works.

Briefly, the script uses the Windows Clipboard to capture the selected word and downloads the source code from the rhyming page (http://www.rhymer.com/RhymingDictionary/)— using the captured word as a search term. Then, calling upon the mysterious (enigmatic?) Regular Expression functions, AutoHotkey parses the Web page source code to pull out the lists of rhymes. Next, the AutoHotkey script inserts those rhyming word lists into menus for both display (panoply?) and action. Pretty (fetching?) cool, huh? But, not for the faint (evanescent?) of heart.

The primary problem I encountered with this script occurred whenever the Web page included an ad in the middle of a list of rhymes. It didn’t properly parse the word list for the menu. In those cases, the word “None” appears as the only choice…and does nothing. For that reason, I added to the main menu the option to load the Web page (Visit Site) with your default browser.

These two scripts represent only a couple of the AutoHotkey possibilities for budding poets. Once (erstwhile?) you add AutoHotkey as a second language (ASL) to your vocabulary, you can steep yourself in Windows scripting creativity.

Note: You may have noticed a number of places in this blog where a word in paratheses and terminated with a question mark,  e.g. (incipient?), follows another fairly common term. That enclosed word sprung from the PoeticWords.ahk script which I kept loaded while (erstwhile?) writing this piece. Many (a plethora?) were not appropriate or didn’t fit my meaning, but it sure got me thinking.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s