Autocorrect anywhere

Post your working scripts, libraries and tools for AHK v1.1 and older
skyth540
Posts: 72
Joined: 24 Aug 2022, 10:07

Autocorrect anywhere

15 Dec 2022, 20:17

First of all, total credit goes to aaston86 for the idea and most of the code
from this post https://www.autohotkey.com/board/topic/100293-autocorrect-anything/

here is my take on his idea, it seems to work well with most words and phrases I've tried. One thing I wish it did was be faster, any tips?

Highlight a misspelled word and press Win+N

Code: Select all

; Windows + N autocorrect selected text
#n::
clipback := ClipboardAll
clipboard=
Send ^c
ClipWait, 1
UrlDownloadToFile % "https://www.google.com/search?q=" . clipboard, temp
FileRead, contents, temp
FileDelete temp
RegExMatch(contents, "<span><b><i>\K.*(?=</i></b></span>)", theword)
   StringReplace, theword, theword, <b><i>,, All
   StringReplace, theword, theword, </i></b>,, All
clipboard := theword
Send ^v
Sleep 500
clipboard := clipback
return
[Mod edit: [code][/code] tags added.]
carno
Posts: 265
Joined: 20 Jun 2014, 16:48

Re: Autocorrect anywhere

17 Dec 2022, 01:24

Tested on Windows 7 Pro and works great! It would be great if you can offer a similar script to give the synonym of a highlighted word.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 92 guests