I'm trying to find a way to assign one key (e.g. \) to capitalize the first letter of "any word" where cursor may be at.
For instance if I'm in the middle of a sentence and like this one, and would like to capitalize one of its words, I'd like to place the cursor on the word, be able to select the word, hit a the selected "key" and have the word capitalize.
Any advice or suggestions will be appreciated.
Many thanks in advance.
Peter
Capitalize first letter of word where cursor at
- Sir Teddy the First
- Posts: 94
- Joined: 05 Aug 2019, 12:31
- Contact:
Re: Capitalize first letter of word where cursor at
Hi,
like this one?
You can replace "^#" with the hotkey you want to press.
In order to use this script you have to place the cursor in front of the word and hit the hotkey. The Script will automatically select the word and capitalize it.
I hope this is what you were looking for.
like this one?
Code: Select all
#SingleInstance Force
^#::
Clipboard := ""
Send +^{Right}
Send ^c
ClipWait
StringUpper Clipboard, Clipboard, T
Send ^v
return
In order to use this script you have to place the cursor in front of the word and hit the hotkey. The Script will automatically select the word and capitalize it.
I hope this is what you were looking for.


Re: Capitalize first letter of word where cursor at
Another version where you can click anywhere on the word you want to capitalize before you press \:
(also preserves clipboard contents)
Code: Select all
\::
ClipSave := Clipboard
Clipboard := ""
Send, {Ctrl down}{Left}{Shift down}{Right}{Ctrl up}{Shift up}
Send, {Ctrl down}c{Ctrl up}
ClipWait, 0.5
StringUpper, Clipboard, Clipboard, T
Send, {Ctrl down}v{Ctrl up}
Clipboard := ClipSave
return