KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Need a Command to Capitalize Selected Text
Topic Summary: Capitalize Selection Command
Created On: 04/05/2022 04:21 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Need a Command to Capitalize Selected Text   - Scriber - 04/05/2022 04:21 PM  
 Need a Command to Capitalize Selected Text   - Lunis Orcutt - 04/05/2022 05:06 PM  
 Need a Command to Capitalize Selected Text   - Edgar - 04/06/2022 09:30 AM  
Keyword
 04/05/2022 04:21 PM
User is offline View Users Profile Print this message

Author Icon
Scriber
Junior Member

Posts: 23
Joined: 04/16/2016

Hello, can someone help me create a command:  "Cap That"?  

What I want is to be able to highlight the desired text and say "Cap That" to have each word selected be capitalized.  I have tried several variations and just cannot get anything to work.

 04/05/2022 05:06 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39832
Joined: 10/01/2006

We assume you are referring to capitalization in non-Dragon friendly environments, since cap-that is supported in Select-&-Say applications. We haven't found a way to make this work except in applications that support Title Case, like Microsoft Word and Corel WordPerfect. Obviously this wouldn't be necessary in Word but since the latest releases of WordPerfect are non-Dragon friendly, if you can manage to dictate in WordPerfect, you can capitalize selected text via the WordPerfect Title Case menu.

 

KnowBrainer 2020 includes another option that isn't exactly what you are looking for but would be much easier than having to capitalize each individual word as you dictate, because you don't have the option of capitalizing your last dictated phrase. For example, in Dragon if you want to capitalize the phrase “friends and family club” you would have to begin by selecting “friends and family club” and then re-dictate by saying cap friends and cap family cap club. In KnowBrainer you can accomplish the same task by saying Title <friends and family club>.



-------------------------

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

 04/06/2022 09:30 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1265
Joined: 04/03/2009

A few years ago I made the same request and, after a lot of work by a number of people, here is what we came up with:

 

 

 

'original WinWrap Basic by Lindsay Adam www.pcbyvoice.com

' modified by Alan Cantor to capitalize the first letter of a paragraph

'    and the first letter after a tab

'modified by edgar to start with the first word's letter

'    and to make sure that the first letter after an:

'       open parentheses ( , open square bracket [ , an open quote " ,

'       an open curly quote “, a dash – , a bullet point ? , or a hyphen -

'    get capitalized

'    made the single holdout variable camelCase

 

   Dim capNext As Boolean

   Dim clip, internalText, characterToChange, precedingCharacter As String

   Dim length As Integer

   capNext = True

   internalText = ""

   characterToChange = ""

   precedingCharacter = "a"

 

   SendKeys "^c", 1

   Wait 0.3

   clip = Clipboard

   Wait 0.3

 

   length = Len (clip)

   For iteration = 1 To length

      characterToChange = Mid(clip, iteration, 1)

      If iteration > 1 Then

         precedingCharacter = Mid(clip, iteration - 1, 1)

         If precedingCharacter = "(" Then

            capNext = True

         ElseIf precedingCharacter = "[" Then

            capNext = True

         ElseIf precedingCharacter = "¿" Then

            capNext = True

         ElseIf precedingCharacter = "…" Then

            capNext = True

         ElseIf precedingCharacter = Chr$(149) Then 'bullet point

            capNext = True

         ElseIf precedingCharacter = Chr$(147) Then 'open curly quote “

            capNext = True

         ElseIf precedingCharacter = Chr$(34) Then 'open regular quote "

            capNext = True

         ElseIf precedingCharacter = "-" Then

            capNext = True

         ElseIf precedingCharacter = Chr$(150) Then 'dash –

            capNext = True

         ElseIf precedingCharacter = Chr$(161) Then 'inverted exclamation mark ¡

            capNext = True

         End If

      End If

      If capNext And (characterToChange >= "a" Or characterToChange <= "z") Then

         internalText = internalText & UCase (characterToChange)

         capNext = False

      Else

         internalText = internalText & characterToChange

      End If

      If characterToChange = " " Or characterToChange = Chr$(9) Or _

      characterToChange = Chr$(10) Or characterToChange = Chr$(13) Or _

      characterToChange = Chr$(34) Then

         capNext = True

      End If

   Next iteration

   Replace (internalText, "'", Chr$(130))

 

   Wait 0.3

   Clipboard internalText

   Wait 0.3

   SendKeys "^v", 1



-------------------------

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

Statistics
32306 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 415 guests browsing this forum, which makes a total of 416 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.