KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: needing a command that capitalises a word that is already typed (in Edge)
Topic Summary: in non-Dragon friendly applications.
Created On: 11/22/2021 12:42 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 11/22/2021 12:10 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1396
Joined: 04/03/2009

Originally posted by: Anandits I would like to have a command that selects the word that my cursor is in and capitalises it.

There are a few hidden assumptions in this request:
1) When you say "cursor" are you talking about the mouse pointer icon (and it hovering above the specific word)

2) or are you talking about the blinking | (vertical bar) which indicates where the insertion of the next text will occur

2a) if 2, what happens if the | is blinking immediately in front of the first letter of the word, immediately behind the last letter of the word, or somewhere in the middle of the word

3) is the word in an "editable" field (in a browser you can select a word - and, e.g., copy it - but not be permitted to paste; this would be an edge case error which would be difficult to code for)?

Your question refers to "double-clicking" which would imply 1 above. The code for 1 and 2 are dramatically different and, if 2, 2a also has quite different code depending on where the blinking | is located. Either way, I have code for all of these cases, just need to know how you plan on using the command.



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

-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 & Shokz OpenComm UC version 1 wireless headset, 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

 11/22/2021 05:30 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1683
Joined: 08/16/2010

Irene,

 

I'm pretty sure that Edgar will come up with something much more sophisticated , but meanwhile here is a simple DVC scripting workaround to experiment with.

 

I've got something a little faster in mind which I will add to my programs later. In the meantime, here's a video example and the DVC Script:

 

 

 

 

Upper word

 

HeardWord "select","word"

Wait 500

SendSystemKeys "{Ctrl+x}"

Wait 300

AppBringUp "C:\Program Files (x86)\Speech Productivity\dictation box top left\dictation box.exe"

Wait 400

SendSystemKeys "{Ctrl+v}"

SendSystemKeys "{Ctrl+a}"

HeardWord "\cap","that"

SendSystemKeys "{Space}"

SendSystemKeys "{Tab}"

SendSystemKeys "{Enter}"



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

https://speechproductivity.eu


Turbocharge your Dragon productivity with 40+ Power Addons


Speech Productivity Forum



 11/22/2021 10:03 PM
User is offline View Users Profile Print this message

Author Icon
Anandits
Advanced Member

Posts: 188
Joined: 03/25/2019

Thank you, Diligence. I appreciate you making this script. I copied it and it works fine technically; but it is too slow to really be useful. I would love something that can do this in the blink of an eye!

 

But may be I am asking something impossible.

 11/22/2021 09:59 PM
User is offline View Users Profile Print this message

Author Icon
Anandits
Advanced Member

Posts: 188
Joined: 03/25/2019

Thank you, Edgar. I was thinking that I would put the | (vertical bar) in the middle of word and then execute the command. But this involves having to click first. If it could be done by only pointing at a word, that would even be better. 

 

This would be in Google Docs. So yes, this would be in an editable field.

 11/23/2021 04:21 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1396
Joined: 04/03/2009

Sub Main

ButtonClick 1, 2' double-left click - selects the word under the mouse pointer

SendKeys "^c", 1' copies the selected word to the clipboard

Wait 0.3' some machines might require slightly more and others might get by with less or none

selectedWord = Clipboard

Wait 0.3

firstLetter = Mid (selectedWord, 1, 1)

firstLetter = UCase (firstLetter)

capitalizedWord = firstLetter

' if the word is more than one letter long…

letters = Len (selectedWord)

If letters > 1 Then

theRestOfTheWord = Mid (selectedWord, 2)

capitalizedWord = capitalizedWord & theRestOfTheWord

End If

SendKeys capitalizedWord, 1

End Sub

 

I tested the above as a Dragon Advanced Script (DPI 15.3). Someone more knowledgeable with DVC scripting might be able to turn it into a faster DVC version. It is not quite "in the blink of an eye" as presented above!



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

-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 & Shokz OpenComm UC version 1 wireless headset, 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

 11/23/2021 09:26 PM
User is offline View Users Profile Print this message

Author Icon
Anandits
Advanced Member

Posts: 188
Joined: 03/25/2019

Edgar, thank you so much. This works beautifully. It is fast enough to still be practical. 

And I managed to use the same script with just a one letter tweak to make it do the opposite. 

I have to do a lot of proofreading in Google docs and this script will be so helpful for me! 

thank you very much for your time. 

 

 

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

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