Number substitute

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hyoko
Posts: 14
Joined: 20 Feb 2018, 10:02

Number substitute

20 Feb 2018, 10:10

Hello, first sorry for my bad english

So, I'm a new user of autohotkey and I need some help I need to replace numbers by alphabet like : when I type "1" it replace by "a". I tried to use ::1::a it works but only with space

I want for exemple to type 1 then 2 without space between them > ab and it replace by 12 not a b > 1 2
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Number substitute

20 Feb 2018, 10:15

Check out the difference between a HotKey and HotStrings !

Code: Select all

1::Send a   ; this is a hotkey
::1::This is a hotstring ; AKA an auto-replace using a trailing space by default
... and welcome 2 the wonderful world of AHK scripting :)
Hyoko
Posts: 14
Joined: 20 Feb 2018, 10:02

Re: Number substitute

20 Feb 2018, 10:22

Thank you ! :)
Hyoko
Posts: 14
Joined: 20 Feb 2018, 10:02

Re: Number substitute

20 Feb 2018, 10:35

Ok I tried it, but it replace only letters by other letters;

Here is my script :

F11::Suspend

a::Send test
0::Send Z
1::Send A
2::Send A
3::Send A
4::Send A
5::Send B
6::Send B
7::Send B
8::Send B
9::Send C

Only "a" key get substitued
gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: Number substitute

20 Feb 2018, 15:13

Your code works. Or, are you using the numeric keypad (numpad) of your keyboard? Then use/add the corresponding key names: https://autohotkey.com/docs/KeyList.htm#Numpad_keys --> example: Numpad1::Send Z
Hyoko
Posts: 14
Joined: 20 Feb 2018, 10:02

Re: Number substitute

20 Feb 2018, 15:16

Yes I was using Numpad, now it's working thank you all :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 378 guests