Replace ;e by é, even inside words

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JPh1
Posts: 42
Joined: 18 Jan 2018, 22:06

Replace ;e by é, even inside words

Post by JPh1 » 27 May 2022, 10:12

I'm trying to have ;e replaced by é, even in words such as invit;es (invités).

My hotkey is
:?:;e::é

But it's not working, presumably because the semicolon is used as comment. How would I modify this hotkey to get it to work?

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Replace ;e by é, even inside words

Post by gregster » 27 May 2022, 10:18

Try

Code: Select all

:?*:;e::é
The semicolon is not a problem here. It would only start an inline comment, if a space or tab would be immediately in front.

JPh1
Posts: 42
Joined: 18 Jan 2018, 22:06

Re: Replace ;e by é, even inside words

Post by JPh1 » 27 May 2022, 10:36

Thanks. But there is something still not right. It works when I type it but I'm using those hotkeys in a program that performs AutoCorret on the whole document at once.
In that case, the rule :?:/e::é works, but the rule :?*:;e::é doesn't (nor did :?:;e::é I had previously).

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Replace ;e by é, even inside words

Post by gregster » 27 May 2022, 10:39

Can't say much without having the same autocorrect thing, I am afraid. Don't know how to reproduce your problem; and don't understand what exactly is happening.
What means "doesn't work" exactly? What's happening?
Why are you using both? Can't autocorrect take care of this?
Anyway, no problems here with ;. It doesn't create an inline comment in the source code in this case - that's for sure.
Seems more like a problem of your autocorrect thingie. Perhaps you can fine-tune it. Does it perhaps insert a space after each ; automatically?

JPh1
Posts: 42
Joined: 18 Jan 2018, 22:06

Re: Replace ;e by é, even inside words

Post by JPh1 » 27 May 2022, 13:17

I was looking for punctuation rules on this program but there are none.

AHK replaces hotkeys as we type, but is there a way to do it in an existing document, in batch mode so to speak?

That would solve the problem.

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Replace ;e by é, even inside words

Post by gregster » 27 May 2022, 17:20

Not with hotstrings, but...
is it a Word document? Well, there is a COM interface to automate MS Word - that would probably help, but I have never used it so far.
If it's just a text file, you can simply read it into a variable, replace the strings, and then write the text back to a file.
In other programs/with other formats, it probably depends on the details. So far, I have still no idea what is actually happening.
Perhaps fixing/modifying the settings of the autocorrecter would be easier, but that is probably not an AHK problem.

Post Reply

Return to “Ask for Help (v1)”