![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Outputting parentheses in SendKeys Topic Summary: Created On: 12/28/2020 01:11 PM Status: Post and Reply |
|
![]() |
![]() |
- Alan Cantor | - 12/28/2020 01:11 PM |
![]() |
![]() |
- PG LTU | - 12/28/2020 01:23 PM |
![]() |
![]() |
- Edgar | - 12/28/2020 04:46 PM |
![]() |
![]() |
- Alan Cantor | - 12/28/2020 08:35 PM |
![]() |
![]() |
- Lunis Orcutt | - 12/28/2020 09:36 PM |
![]() |
![]() |
- Edgar | - 12/29/2020 11:43 AM |
![]() |
![]() |
- jmcvay | - 12/31/2020 12:41 PM |
![]() |
![]() |
- Lunis Orcutt | - 12/31/2020 07:24 PM |
![]() |
![]() |
- Edgar | - 01/01/2021 11:54 AM |
![]() |
![]() |
- jmcvay | - 01/02/2021 03:36 PM |
![]() |
![]() |
- Edgar | - 01/03/2021 11:02 AM |
![]() |
![]() |
- Edgar | - 01/03/2021 11:16 AM |
![]() |
![]() |
- PG LTU | - 12/31/2020 07:25 PM |
![]() |
|
I'm writing a command that outputs several strings. Some strings are wrapped in parentheses: |
|
|
|
![]() |
|
So strange. Ha ha ha. Escape them.
SendKeys "Hello " & "{(}" & "World" & "{)}"
or simply: SendKeys "Hello {(}World{)}"
-------------------------
|
|
|
|
![]() |
|
Hi Alan! This question comes up so often (in different flavors) that I decided to dedicate a post to it: ------------------------- -Edgar |
|
|
|
![]() |
|
Hi Philip and Edgar,
Thank you!!! |
|
|
|
![]() |
|
We are not certain if the following approach will work but KnowBrainer 2017 includes a Paren <dictation> command which will allow you to say Paren <anything you want>. If this sounds good and you are not using KnowBrainer, consider naming your command Paren <dictation>. The script is:
Sub Main out = " {(}" + ListVar1 + ")" SendKeys out End Sub ------------------------- Change "No" to "Know" w/KnowBrainer 2020 |
|
|
|
![]() |
|
Sub Main
out = " {(}" + ListVar1 + ")"
SendKeys out
End Sub
My version of this command looks like: Dim holdString As String holdString = ListVar1 holdString = Replace (holdString, "(", "{(}") holdString = Replace (holdString, "open paren", "{(}") holdString = Replace (holdString, "left paren", "{(}") holdString = Replace (holdString, "{", "{{}") holdString = Replace (holdString, "open curly brace", "{{}") holdString = Replace (holdString, "left curly brace", "{{}") holdString = Replace (holdString, "[", "{[}") holdString = Replace (holdString, "open square bracket", "{[}") holdString = Replace (holdString, "left square bracket", "{[}") holdString = Replace (holdString, "<", "{<}") holdString = Replace (holdString, "open angle bracket", "{<}") holdString = Replace (holdString, "left angle bracket", "{<}") holdString = Replace (holdString, "\", "{\}") holdString = Replace (holdString, "back /", "{\}") holdString = Replace (holdString, "back slash", "{\}") SendKeys holdString, 1
Clipboard (holdString)' optional This code is public domain and open source, I encourage Lunis to freely use it. ------------------------- -Edgar |
|
|
|
![]() |
|
Edgar, I tried both Lewis' version and yours. Lunis' version does indeed throw an error. Yours didn't enclose the dictated text in parentheses and seemed to type the dictated text one letter at a time, rather than entering it as a chunk. ------------------------- James McVay |
|
|
|
![]() |
|
We use the existing KnowBrainer Paren <dictation> and Angle <dictation> commands all the time without issue ------------------------- Change "No" to "Know" w/KnowBrainer 2020 |
|
|
|
![]() |
|
We will need to see your code. ------------------------- -Edgar |
|
|
|
![]() |
|
We will need to see your code.
------------------------- James McVay |
|
|
|
![]() |
|
You are right, in my version, the opening parentheses seems to be failing for some reason. Will try to figure it out and post back here… ------------------------- -Edgar |
|
|
|
![]() |
|
Okay, stupid logic error - because the opening curly brace is both a legitimate printable character and also part of the escapement they need to come first in the replacement order: Sub Main Dim holdString As String holdString = ListVar1 holdString = Replace (holdString, "open curly brace", "{{}") holdString = Replace (holdString, "left curly brace", "{{}") holdString = Replace (holdString, "{", "{{}") holdString = Replace (holdString, "(", "{(}") holdString = Replace (holdString, "open paren", "{(}") holdString = Replace (holdString, "left paren", "{(}") holdString = Replace (holdString, "[", "{[}") holdString = Replace (holdString, "open square bracket", "{[}") holdString = Replace (holdString, "left square bracket", "{[}") holdString = Replace (holdString, "<", "{<}") holdString = Replace (holdString, "open angle bracket", "{<}") holdString = Replace (holdString, "left angle bracket", "{<}") holdString = Replace (holdString, "\", "{\}") holdString = Replace (holdString, "back /", "{\}") holdString = Replace (holdString, "back slash", "{\}") SendKeys holdString, 1 Clipboard (holdString) End Sub ------------------------- -Edgar |
|
|
|
![]() |
|
This takes me back. Both versions here (DAS and DVC) allow for saying "paren that" to put the parentheses around an entire selected phrase or "paren xyz" to dictate a perenthesized phrase: -------------------------
|
|
|
FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.