KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Web Searches Using Content Of Clipboard
Topic Summary:
Created On: 05/11/2022 05:34 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Web Searches Using Content Of Clipboard   - Protipious Maximus - 05/11/2022 05:34 PM  
 shiftWeb Searches Using Content Of Clipboard   - Lunis Orcutt - 05/11/2022 06:27 PM  
 shiftWeb Searches Using Content Of Clipboard   - Lunis Orcutt - 05/11/2022 06:35 PM  
 Searches Using Content Of Clipboard   - Protipious Maximus - 05/12/2022 07:21 PM  
 Web Searches Using Content Of Clipboard   - monkey8 - 05/12/2022 03:27 AM  
 Web Searches Using Content Of Clipboard   - Lunis Orcutt - 05/12/2022 04:52 PM  
 Web Searches Using Content Of Clipboard   - monkey8 - 05/11/2022 07:08 PM  
 Web Searches Using Content Of Clipboard   - Protipious Maximus - 05/12/2022 07:13 PM  
 Web Searches Using Content Of Clipboard   - Protipious Maximus - 05/17/2022 12:36 AM  
 Web Searches Using Content Of Clipboard   - Stephan Kuepper - 05/13/2022 10:01 AM  
 Web Searches Using Content Of Clipboard   - Matt_Chambers - 05/13/2022 10:12 AM  
 Web Searches Using Content Of Clipboard   - monkey8 - 05/13/2022 12:07 PM  
 Web Searches Using Content Of Clipboard   - monkey8 - 05/17/2022 07:58 AM  
 Web Searches Using Content Of Clipboard   - Protipious Maximus - 05/18/2022 02:10 AM  
 Web Searches Using Content Of Clipboard   - monkey8 - 05/18/2022 03:23 AM  
 Web Searches Using Content Of Clipboard   - MDH - 05/18/2022 11:18 AM  
 Web Searches Using Content Of Clipboard   - Protipious Maximus - 05/20/2022 01:25 AM  
Keyword
 05/11/2022 05:34 PM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/2022

Problem with Web Searches Using Clipboard

Currently using DNS 14.0

Every time I perform a search only the first
word is pasted into the Google search box. For example, if the clipboard contains the phrase "the great barrier reef" only the word "the" is pasted into the Google search engine. I've tried using other sites other than Google and the same thing happens on each and every one of them. Only the first word from the contents of the clipboard or ever pasted.

I tried searching the forums but couldn't find anyone else that was having this problem. I'm hoping someone can assist.

Here is the code I'm using:


Sub Main
a = Clipboard
Wait 1.0
ShellExecute "https://www.google.com/search?hl=en&as_q=" & a
End Sub

 

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

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39958
Joined: 10/01/2006

                    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 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1



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

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39958
Joined: 10/01/2006

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 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

 05/12/2022 07:21 PM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/2022

Much appreciated. Everything appears to be working perfectly now.

 05/12/2022 03:27 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Lunis Orcutt                   

 

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



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



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

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39958
Joined: 10/01/2006

SWEET! We just updated KnowBrainer 2020 via the KBCommandsUpdater



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

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

 05/11/2022 07:08 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Protipious Maximus I tried searching the forums but couldn't find anyone else that was having this problem. I'm hoping someone can assist.

 

 

 

 

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," ","+")
End Sub


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



 05/12/2022 07:13 PM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/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.

 

 05/17/2022 12:36 AM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/2022

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).

Now, how does one perform the same search if the words on the clipboard contain both spaces and quotation marks?

This is what I have so far:
a = Replace$(Clipboard," ","+" & Replace$(Clipboard,"""","%22%"))

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?

 

 05/13/2022 10:01 AM
User is offline View Users Profile Print this message

Author Icon
Stephan Kuepper
Top-Tier Member

Posts: 2232
Joined: 10/04/2006

Kudos to everyone for reinventing the wheel. Dragon has had a command "Search the web for XYZ" for ages, using the standard search engine.

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

www.egs-vertrieb.de - www.spracherkennungscloud.de

 05/13/2022 10:12 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 581
Joined: 08/09/2018

Originally posted by: Stephan Kuepper 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.

 

 05/13/2022 12:07 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Stephan Kuepper Kudos to everyone for reinventing the wheel. Dragon has had a command "Search the web for XYZ" for ages, using the standard search engine.

 

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.

 

 



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



 05/17/2022 07:58 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Protipious Maximus 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). Now, how does one perform the same search if the words on the clipboard contain both spaces and quotation marks? This is what I have so far: a = Replace$(Clipboard," ","+" & Replace$(Clipboard,"""","%22%"))

 

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.



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



 05/18/2022 02:10 AM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/2022

I opened up my Command Browser and here is the code that I see.

Sub Main
a = Replace$(Clipboard," ","+")
ShellExecute "https://www.google.com/search?hl=en&as_q=" & a
End Sub

Your code is accurate and correct, but something on my computer is preventing searches anytime the clipboard text contains quotation marks. I'm sure it must be something on my computer causing the problem.

Anytime the clipboard text contains quotation marks the search takes me to this page https://www.google.com/webhp?hl=en&as_q= and never provides any search results.

I'm using Google Chrome by the way, but I also tried making Microsoft Edge the default browser and tried the search again, but it always takes me to this page https://www.google.com/webhp?hl=en&as_q=  

And the same thing occurred with Mozilla Firefox it just took me to  the same https://www.google.com/webhp?hl=en&as_q=

I then tried using a MyCmds.dat file from 2 years ago thinking that maybe I had some corruption in my original file, but unfortunately the same thing happened with that file, so I'm guessing that there's just something in my computer or one of my applications that's causing a conflict somewhere. I tried disabling a few applications but that didn't seem to work.

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!

 

 



 05/18/2022 03:23 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3904
Joined: 01/14/2008

Originally posted by: Protipious Maximus Your code is accurate and correct, but something on my computer is preventing searches anytime the clipboard text contains quotation marks. I'm sure it must be something on my computer causing the problem.

 

   

 

Try this:

 

Sub Main
    a = Replace$(Clipboard," ","+")
    a = Replace$(a, """", "%22")
    ShellExecute "https://www.google.com/search?hl=en&as_q=" & a
End Sub


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

 05/18/2022 11:18 AM
User is offline View Users Profile Print this message

Author Icon
MDH
Top-Tier Member

Posts: 2266
Joined: 04/02/2008

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


-------------------------
 05/20/2022 01:25 AM
User is offline View Users Profile Print this message

Author Icon
Protipious Maxi..
New Member

Posts: 6
Joined: 05/11/2022

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.

 

Statistics
32323 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 415 guests browsing this forum, which makes a total of 415 users using this forum.

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