Author Topic: Capitalize The First Letter Of Every Word In A String  (Read 118 times)

dryh2o

  • Newbie
  • *
  • Posts: 16
Capitalize The First Letter Of Every Word In A String
« on: September 25, 2024, 09:40:13 AM »

I was hoping that capitalizing the words in the command would translate them to being capitalized in the variable, but that's not the case. So... How can I convert the first letter of each word in the "NameThis" variable to caps?

All I was about to find was for the DICTATION token, and even that is only the first character in each line. Another option I considered might be to use QuickInput, but the problem seems the same. I'd have to determine when to hold the shift key down for the first letter of each word and it would be much slower than using paste.

I appreciate any assistance.


name this [Food;Equipment;Guns and Ammo;Clothing and Armor]

Set text [NameThis] to '{CMDSEGMENT:1}'
DISABLED - Move mouse cursor to screen coordinates (1160, 435)
DISABLED - Click left mouse button [duration 0.1 seconds
Set Windows clipboard to '{TXT:NameThis} -----'
Press Left Ctrl+V keys and hold for 0.1 seconds and release
Pause 0.01 seconds

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Capitalize The First Letter Of Every Word In A String
« Reply #1 on: September 25, 2024, 09:43:55 AM »
That's exactly what the "{TXTTITLE:}" token does.

dryh2o

  • Newbie
  • *
  • Posts: 16
Re: Capitalize The First Letter Of Every Word In A String
« Reply #2 on: September 25, 2024, 09:51:02 AM »
Darn it... I searched all through the documentation and never once thought to search for title case.

Thank you.