Doing maths w\ autocorrect script

Get help with using AutoHotkey and its commands and hotkeys
Scriefers
Posts: 3
Joined: 13 Mar 2017, 21:46

Doing maths w\ autocorrect script

14 Mar 2018, 20:59

I'm still new to AHK and I'm having trouble with modifying an autocorrect script to do maths and unit conversions on the go, e.g. typing in 5inchtocm and it correcting it to 12.7cm or typing 5*3 and getting 15.

Here's the code:

Code: Select all

#NoEnv
#SingleInstance force

MoveCaret:
IfWinNotActive, New Hotstring
    return
Send {HOME}
Loop % StrLen(Hotstring) + 4
    SendInput {Right}
SetTimer, MoveCaret, Off
return

#Hotstring R 

::beleagured::beleaguered
::beligum::belgium
::beleif::belief
::beleiev::believe
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Doing maths w\ autocorrect script

15 Mar 2018, 00:30

Can you do that with hotstrings though? Interesting.
I am your average ahk newbie. Just.. a tat more cute. ;)
User avatar
Micromegas
Posts: 213
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Doing maths w\ autocorrect script

15 Mar 2018, 06:44

Nwb wrote:Can you do that with hotstrings though? Interesting.
Well, you can in principle. But it would be far more complicated than the code in the original post, which isn't even an attempt at solving the problem.

Return to “Ask For Help”

Who is online

Users browsing this forum: anaxio, FanaticGuru, Google [Bot], hotkeyguy, MannyKSoSo, Martin, nicwillu, swagfag, Xtra and 252 guests