How to get “smart punctuation” with word prediction/completion

This AutoHotkey script is a way to make punctuating more efficient when using word prediction or completion with automatic spacing enabled. Using this script, you don’t have to backspace in order to punctuate after predicting a word. When you press the punctuation, the script will backspace for you, insert the mark, then space. That’s the first part. The second part accounts for times you may type an unknown word or otherwise not choose a prediction, so there would be no trailing space. This part specifies that if a letter appears before the punctuation, the script will only insert the mark, then space. I left the quotation mark alone because of the different inside/outside punctuation rules. OpusApp restricts it to Word.

#IfWinActive ahk_class OpusApp

#Hotstring *
::.::
Send, {bs}. `
return

::,::
Send, {bs}, `
return

::?::
Send, {bs}? `
return

::!::
Send, {bs}{!} `
return

::)::
Send, {bs})
return

#Hotstring ? *
::.::
Send, . `
return

::,::
Send, , `
return

::?::
Send, ? `
return

::!::
Send, {!} `
return

Advertisements
This entry was posted in Disability, Technology and tagged , , , , , , . Bookmark the permalink.

3 Responses to How to get “smart punctuation” with word prediction/completion

  1. hand2mouth says:

    Note that the closing parenthesis is missing the spaced backtick. I left it as an example of how nitpicky inside/outside punctuation rules are…

  2. Pingback: Friday News Feed on a Sunday 10-15 « The ASSET Blog

  3. Pingback: Friday News Feed (10.15.2009) « The ASSET*AmeriCorps Blog

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