![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Web Searches Using Content Of Clipboard Topic Summary: Created On: 05/11/2022 05:34 PM Status: Post and Reply |
|
![]() |
|
Problem with Web Searches Using Clipboard
|
|
|
|
![]() |
|
Welcome (See Mission Statement)
KnowBrainer 2020 (Third party command utility) includes lots of AI commands; including the one you are looking for. Feel free to copy the following KnowBrainer Advanced-Scripting command into Dragon.
Command Name:
Google For <dictation>
Script:
Sub Main ShellExecute "http://www.google.com/" Wait 1.5 SendKeys ListVar1 Wait 0.5 SendKeys "~" End Sub ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
KnowBrainer also includes a command called Google That which copies highlighted text to the clipboard and performs a Google search. Note that the following is a DVC script so in order to use it, you will need to copy an existing mouse command and replace the text with the following:
SendSystemKeys "{Ctrl+c}" Wait 200 ShellExecute "http://www.google.com/" Wait 3000 SendSystemKeys "{Ctrl+v}" Wait 500 SendSystemKeys "{Enter}" ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
When you search Google in this manner for the contents of the clipboard which happens to be a multiple word string you need to replace the spaces in the string with "+" signs, so try this, You don't need waits, So suggested command name "Search Google for clipboard"
Sub Main a = Replace$(Clipboard," ","+") ShellExecute "https://www.google.com/search?hl=en&as_q=" & a End Sub
or Sub Main ShellExecute "https://www.google.com/search?hl=en&as_q=" & Replace$(Clipboard," ","+") ------------------------- |
|
|
|
![]() |
|
Command Name:
Google For <dictation>
Script:
Sub Main
ShellExecute "http://www.google.com/"
Wait 1.5
SendKeys ListVar1
Wait 0.5
SendKeys "~"
End Sub
Lunis you can make that command, "Google for <dictation>" a lot quicker, virtually instant, by using this:
Sub Main ShellExecute "https://www.google.com/search?hl=en&as_q=" & Replace$(ListVar1," ","+") End Sub ------------------------- |
|
|
|
![]() |
|
SWEET! We just updated KnowBrainer 2020 via the KBCommandsUpdater ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
I appreciate the information. The information that you provided was very helpful, now everything appears to be working perfectly. I'm so happy I came across this forum.
|
|
|
|
![]() |
|
Much appreciated. Everything appears to be working perfectly now. |
|
|
|
![]() |
|
Kudos to everyone for reinventing the wheel. Dragon has had a command "Search the web for XYZ" for ages, using the standard search engine.
------------------------- |
|
|
|
![]() |
|
Only if you enable the web search commands under Tools, Options, Commands. For those of us that prefer to use our own wording, or to have more predictable commands, the solutions suggested by Lunis and Lindsay are big improvements. In general, I don't use very many of Dragon's built-in commands. I prefer to use the commands I have created over the years.
|
|
|
|
![]() |
|
Maybe you should read the question Stephan, "Problem with Web Searches Using Clipboard",there is no Dragon command to search Google for the clipboard. The forum is about answering users questions and not posting related commands.
------------------------- |
|
|
|
![]() |
|
Everything appears to be working fine using the code a = Replace$(Clipboard," ","+") for web searches with words on the clipboard that have spaces in them). I tried to convert the quotation marks to ASCII But unfortunately it doesn't seem to work as expected when searching for phrases enclosed in quotation marks. Ex. ("Tom Cruise) , "Great Barrier Reef" etc . . Can anyone point me in the right direction?
|
|
|
|
![]() |
|
I tried to convert the quotation marks to ASCII
But unfortunately it doesn't seem to work as expected when searching for phrases enclosed in quotation marks. Ex. ("Tom Cruise) , "Great Barrier Reef" etc . .
Can anyone point me in the right direction?
If the clipboard contains quotation marks then the script I gave you above should still work perfectly. Just tested it and it does. When Google searches for quotation marks using the q= notation it makes no alterations to the character for quotation marks so the original script should work. You are overthinking it, suggest you try again with the original script as it works perfectly here when searching for clipboard contents that contain spaces, no spaces or quotation marks or any combination of. ------------------------- |
|
|
|
![]() |
|
I opened up my Command Browser and here is the code that I see. Unfortunately, this appears to be one of those problems that may be unsolvable for now, but perhaps someone will come across this post months from now who experienced a similar problem and can provide some information. I appreciate all your information though. I'll just be content with regular searches for now which work perfectly!
|
|
|
|
![]() |
|
Try this:
Sub Main a = Replace$(Clipboard," ","+") a = Replace$(a, """", "%22") ShellExecute "https://www.google.com/search?hl=en&as_q=" & a End Sub ------------------------- |
|
|
|
![]() |
|
Sub Main a = Replace$(Clipboard," ","+") a = Replace$(a, """", "%22") ShellExecute "https://www.google.com/search?hl=en&as_q=" & a End Sub
This looks like alien activity!
MDH
------------------------- |
|
|
|
![]() |
|
Hey, this is incredible! Now everything is working perfectly! I can now perform searches successfully using quotation marks. I don't know how to thank you enough. I don't know if I would have been able to figure this one out without some help, so thanks again.
|
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.