4

I have a weird typo that I keep making over and over, and instead of actually working on my typing skills, I want to edit my AutoHotkey script to compensate for this.

sometimes when I type the capital I I hit the : button and type "I:" and I want AHK to replace that string with just the letter I.

I already have a similar Hotkey

::custoemr::customer

But since the string uses a colon, I am having difficulty getting it to do what I want.

Any I:deas? (See?)

Cadoiz
  • 1,446
  • 21
  • 31

2 Answers2

4

Yes! It is a work around, but it works...

#Hotstring EndChars :
:?O:I::I

Anything below the line #Hotstring EndChars : will use the : as EndCharacter.

Robert Ilbrink
  • 7,738
  • 2
  • 22
  • 32
  • And how to disable this construction? If i want to use normal behavior after some lines below that one? – shytikov Feb 23 '15 at 12:26
  • Answer to my question, how to disable this option for other hotkeys combinations: `:*?O:AA::Å` This will print Scandinavian `Å` instead of typed `AA`. – shytikov Feb 23 '15 at 12:42
  • Instead of using :*?O:AA::Å, why not use :*?O:0A::Å (zero+A). Also I think that if you set your endchar to : if only works for hotstrings below that line, so write all other hotstrings above the EndChar definition line... – Robert Ilbrink Feb 24 '15 at 19:06
  • To end this, you can use this #Directive after it: `#Hotstring EndChars -()[]{}:;'"/\,.?!\`n \`t` (From https://www.autohotkey.com/docs/Hotstrings.htm#EndChars) – Cadoiz May 04 '20 at 20:04
2

Not sure if this will work for you it changes I:Space into I, but it requires the Space.

:*:I`: ::I ; The `is the escape but with 3 ::: AutoHotKey still get's confused
Robert Ilbrink
  • 7,738
  • 2
  • 22
  • 32
  • How did you insert the keyboard-like characters into your answer? Im still new to Stackoverflow and learning my way around... – georgiamadkow Feb 25 '13 at 14:12
  • OK, I just tried this one, and it does work for "I: " with a space, but doesn't work if I make the typo in the middle of a word. – georgiamadkow Feb 25 '13 at 14:17
  • Updated the code and included a question mark in the beginning to make it act at any time. Oh it should now work without the space, because the : is the end character! When I type HI:JKL it turns it into HIJKL. – Robert Ilbrink Feb 25 '13 at 15:54
  • You can click on `edit` for an answer to see the source code (without actually submitting the edit). That's what i just did on your question. – Cadoiz May 04 '20 at 19:54