Author Topic: Set a CMDSEGMENT to clipboard with case as written in the command  (Read 1011 times)

librarian

  • Newbie
  • *
  • Posts: 15
When I say: genre [Australian music;Heavy metal (Music);Rock music]
Code: [Select]
Set Windows clipboard to '{CMDSEGMENT:1}'
Press Left Ctrl+V keys and hold for 0.1 seconds and release

The output is "australian music" or "heavy metal (music) or "rock music"

How can I set the clipboard with the case as I have it in the command or translate it to sentence case? The only options appear to be title case or all upper/lower case.

I have played around a bit with the 'Set a Text Value" function with no luck. If I can get it to work I might have a few dozen different genres listed so using if statements to write the text would be time consuming to set up.

Thanks

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Set a CMDSEGMENT to clipboard with case as written in the command
« Reply #1 on: March 30, 2022, 05:04:19 PM »
Recognized predefined text will be lowercase, that is not specific to that token.

If you want to use the exact case entered into the "When I say" field, you'd need to retrieve the contents of the field (E.G. using the "{CMDWHENISAY}" token or the WhenISay() method in an inline function), parse and split that, then match it to the recognized text (using a case-insensitive comparison).
Using an inline function for this would likely be the more efficient method.


If you are referring to using the "Set a Text Value" action directly with a token, you'll want to read the documentation on tokens, to gain an understanding of why that cannot work.

This topic may also be of use, in addition to the official documentation:
Variables and tokens summed up