Capitalize letter of a clipboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Psygnosis
Posts: 4
Joined: 28 Sep 2020, 13:14
Contact:

Capitalize letter of a clipboard

Post by Psygnosis » 15 Aug 2022, 13:15

Hi all,
I'm trying to build up a script that do something like this.

1. it take the clipboard and append a text
2. case select to choose a specific test
3. wait for the new clipboard2
4. trasform clipboard2 by replace - with _ and capitalize first letter.
5. append the text chose in the point 2 with the text trasformed in point 4.

now, while for the point 1 and 2 and maybe 3 it's relatively easy to do, I'm struggle with the 4.
I can replace - with _ with StrReplace but I can't capitalize letter.

I don't want you to help me with the whole script but I appreciate some help for raplace and trasform capital letter because I can't found out a way.
By searching in the forum I've found out this string
aa:= % RegExReplace(e4x, "(?<=^)([a-z])|(?<=\.|!|\?)(\s*[a-z])", "$u1$u2") sometimes with $U0 but it doesn't work and I can't understand the code

thank you in advance

sofista
Posts: 645
Joined: 24 Feb 2020, 13:59
Location: Buenos Aires

Re: Capitalize letter of a clipboard

Post by sofista » 15 Aug 2022, 14:06

Try:

Code: Select all

str := "capitalize first letter"
MsgBox, % RegExReplace(str, "(?<=^)([a-z])|(?<=\.|!|\?)(\s*[a-z])", "$T1$T2")    ; T -> Title case

Post Reply

Return to “Ask for Help (v1)”