Macro of function to capitalize all words in selection
-
Is this even possible with Notepad++??
-
You could record the following Replace-All action in a macro.
Open the Replace dialog (ctrl+h) and set up the following:
Find-what zone:
(\w)(\w+)
Replace-with zone:\U\1\E\2
Search mode: Regular expression
In-selection checkbox: Ticked(…start macro recording here…)
Action: Press the Replace All button
(…end macro recording here…test/save/name/playback your macro…) -
Or maybe just Alt+U ? (Edit->Convert Case to->Proper Case)
Cheers
Claudia -
What version is that in?
Am I using Notepad++ v6.9.2
and alt +U (Edit->Convert Case to->Proper Case) is not available.
Only Upper and Lower cases are there. -
Haha…yea, that’s the better option…must be that someone is making me think every problem is best solved with regex. :)
-
if I correctly researched then the commit was made on the 30 Jun 2016 which means
the next version was 7.0.@Scott-Sumner
Yes Scott, looked like you were in the regex mood :-D
But don’t be afraid, happens to me also too often - trying to solve something
with python script just to find out that it is builtin :-DCheers
Claudia -
@Scott-Sumner
Will the macro remember the In-selection checkbox: Ticked?
I’d hate to re-run and have it replace everything :) -
Well…I hope you didn’t ignore @Claudia-Frank 's suggestion because it is easier (and thus better) than my original solution. That being said, I have these comments:
Comment #1: With the regular expression replacement solution, the macro WILL remember the In selection setting. When you run the macro and you have nothing selected, nothing will happen.
Comment #2: With @Claudia-Frank 's solution, if there is nothing selected, the convert-case command will do nothing when run from a macro, and isn’t even selectable via the menus when using the command interactively.
Thus, neither way of doing it is like some other Notepad++ commands that run on the whole file if there is no active selection.
-
@Claudia-Frank
Thanks for the info.
I updated Notepad++ to v7.5.1 and now I have lots of options! :)Sorry it took so long to reply…
Have to wait 20 minutes between posts because I’m new with no reputation. :)