KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Dictating Initials Macro
Topic Summary: Dictating MF and Getting M.F. in Italics
Created On: 06/20/2021 08:55 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Dictating Initials Macro   - Kiwiman - 06/20/2021 08:55 AM  
 Dictating Initials Macro   - Alan Cantor - 06/20/2021 11:00 AM  
 Dictating Initials Macro   - kkkwj - 06/20/2021 05:28 PM  
 Dictating Initials Macro   - Edgar - 06/21/2021 09:05 AM  
 Dictating Initials Macro   - Kiwiman - 06/21/2021 02:21 PM  
 Dictating Initials Macro   - Alan Cantor - 06/21/2021 03:46 PM  
 Dictating Initials Macro   - Kiwiman - 06/21/2021 03:55 PM  
 Dictating Initials Macro   - Edgar - 06/21/2021 07:34 PM  
 Dictating Initials Macro   - kkkwj - 06/22/2021 12:30 AM  
 Dictating Initials Macro   - Kiwiman - 06/23/2021 12:01 PM  
Keyword
 06/20/2021 08:55 AM
User is offline View Users Profile Print this message


Kiwiman
Junior Member

Posts: 24
Joined: 05/08/2009

Hello,

I would like to be able to say initials of people e.g. AB and have Dragon produce A.B. in italics followed by a comma that is not italicized.

Here's my script with lists, but I can only get it to work if I have something like alpha, bravo, charlie to the right of the backslash.  Now, Dragon seems to default to printing AB instead of A.B.  Even if I put Dragon in Command mode it doesn't produce A.B.

<firstinitial> <secondinitial>
Sub Main
    SendKeys "^i"
    SendKeys Mid(ListVar1, 1, InStr(ListVar1, "\")-1)
    SendKeys Mid(ListVar2, 1, InStr(ListVar2, "\")-1)
    SendKeys "^i"
    SendKeys ","
End Sub
<firstinitial>
A.\A
B.\B
C.\C
<secondinitial>
A.\A
B.\B
C.\C
Note: if I make the lists something like
A.\alpha
B.\bravo
C.\charlie
This works.

 06/20/2021 11:00 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4144
Joined: 12/08/2007

Try adding a word to the start of the command name, maybe something like "initial" or "dotty" or "zap" or whatever.

zap <firstinitial> <secondinitial>
 06/20/2021 05:28 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 786
Joined: 11/05/2015

If you want a powerhouse version of your script, look around the forum for Edgar's script that generates unpronounceable variable names (like Abdeb, CZ, etc.) You'll have to modify it a tiny bit to inject a dot after each character, but it's very capable. I can't remember the name of it, sorry. His script won't plug up your vocabulary or force you to use a list of specific keywords like alpha bravo.

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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse

 06/21/2021 09:05 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1176
Joined: 04/03/2009

This is a slight modification of my script…

As AG says, use a trigger word or phrase - Something memorable, easy to pronounce and unlikely to be used at the start of a normal phrase (I use "zotz", a nonsense word which I have added to my vocabulary and "ack"; AG likes "puff"). Your command name would be something like:

Ack <dictation>

Sub Main

Dim words() As String' dimension a string array

Dim k As Integer

Dim result As String

 

   SendKeys "^i"

   result = ""

words = Split(ListVar1," ")

For k = 0 To UBound(words)

result = result & UCase(Left(words(k), 1)) & "."

Next

SendKeys result

   SendKeys "^i"

   SendKeys ","

End Sub



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

-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

 06/21/2021 02:21 PM
User is offline View Users Profile Print this message


Kiwiman
Junior Member

Posts: 24
Joined: 05/08/2009

Thanks so much to all respondees!

I tried adding a word like 'zap' to my initial script, but could only get the zap 'AA' to produce the A.A. in italics I wanted. None of the other iterations would work even with just a few lines in the lists. e.g.

A.\A
B.\B
C.\C


A.\A
B.\B
C.\C

zap
Sub Main
SendKeys "^i"
SendKeys Mid(ListVar1, 1, InStr(ListVar1, "\")-1)
SendKeys Mid(ListVar2, 1, InStr(ListVar2, "\")-1)
SendKeys "^i"
SendKeys ","
End Sub

Should my lists be structured differently?

Also, thank you Edgar for your script.

I did try it with:
zotz

using the list:

A.\A
B.\B
C.\C

Here again, I could only get zotz 'A' to work. Zotz 'B' or Zotz 'C' did not work even after I Trained each instance.

Also, could you kindly show me how to incorporate the ListVar2 into your script, so that I could say for example zotz 'AD' and have it print A.D. in italics.

Best,

Harris

I did try your
 06/21/2021 03:46 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4144
Joined: 12/08/2007

This script works for me:

zap <a-z-alpha-zulu><a-z-alpha-zulu>

<a-z-alpha-zulu> consists of

A
Alpha
B
Bravo
C
Charlie
D
Delta
E
Echo
etc.

Sub Main
Dim x, y, z as String
Let x = Left(ListVar1, 1)
Let y = Left(ListVar2, 1)
Let z = x & "." & y & "."
SendKeys z, True
End Sub

I added the military alphabet to the list as a failsafe in case Dragon struggles, which it inevitably will, with letters that have similar sounds. Nevertheless, the script seems to work when I use the raw letters, the military alphabet, or a combination of the two.
 06/21/2021 03:55 PM
User is offline View Users Profile Print this message


Kiwiman
Junior Member

Posts: 24
Joined: 05/08/2009

Perfect! Thanks Alan, this does work well.
 06/21/2021 07:34 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1176
Joined: 04/03/2009

Just so you understand, mine is an "open-ended" command that requires no list. The easiest would be to just say the person's name throughout put their initials formatted the way you want them.

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

-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

 06/22/2021 12:30 AM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 786
Joined: 11/05/2015

Yes, you don't need lists with Edgar's script. It takes the first character of every word you speak and outputs it with a trailing ".", like so:

say "ack this is a test" => T.I.A.T.

say "ack alpha apple" => A.A.
say "ack apple brownie" => A.B.




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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse

 06/23/2021 12:01 PM
User is offline View Users Profile Print this message


Kiwiman
Junior Member

Posts: 24
Joined: 05/08/2009

Thank you Edgar and kkkwj for your clarification!

Very cool way to execute the macro without needing a list.

I've learned a lot from this post.

Best,

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

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