Page 1 of 2

Google, Dictionary, Thesaurus Search

Posted: 07 May 2015, 16:47
by FanaticGuru
Google Search
Preforms a google search of highlighted text or text input if no text is highlighted using the default browser.

Code: [Select all] [Expand] [Download] (Google.ahk)GeSHi © Codebox Plus


Dictionary Search
Preforms a dictionary search at Dictionary.com of the highlighted text or text input if no text is highlighted. The results are trimmed down and displayed in a Gui using an ActiveX control.
  • When Gui is active, can double click on word in Gui to then search for that word.
  • When Gui is active, can use Left and Right arrows to move back and forth through history.

Code: [Select all] [Expand] [Download] (Dictionary.ahk)GeSHi © Codebox Plus


Thesaurus Search
Preforms a thesaurus search at Thesaurus.com of the highlighted text or text input if no text is highlighted. The results are trimmed down and displayed in a Gui using an ActiveX control.
  • When Gui is active, can double click on word in Gui to then search for that word.
  • When Gui is active, can use Left and Right arrows to move back and forth through history.
  • When Gui is active, can use Tab to move to box at top to enter new word.

Code: [Select all] [Expand] [Download] (Thesaurus.ahk)GeSHi © Codebox Plus


FG

Re: Google and Dictionary Search

Posted: 08 May 2015, 15:08
by Iomega0318
This looks interesting :)

Re: Google and Dictionary Search

Posted: 13 May 2015, 17:07
by FanaticGuru
Updated Dictionary on First Page

Version: 1.1
Change Log: 2015-05-13


  • General improvements in formatting and display of html
  • Used html styles to format text instead of RegExReplace for most of the formatting
  • Added ability to use Ctrl-C to copy from Gui
  • Added ability to select text in Gui then hit hotkey to find the definition of a word within a definition
  • Added ability to Double Click on a word in the Gui to find the definition of a word within a definition
FG

Re: Google and Dictionary Search

Posted: 11 Jun 2015, 20:26
by AlleyArtwork
This dictionary search is fantastic!

Re: Google and Dictionary Search

Posted: 11 Jun 2015, 21:13
by Joe Glines
This is awesome! How about throwing in a back button?

Re: Google and Dictionary Search

Posted: 12 Jun 2015, 18:38
by rommmcek
It's a very fast, mind blowing idea! (Not only for dictionary. I already imagine adds free browsing!)
P.s.: Yes, skipping back-forth either in form of buttons or Alt-Left-Right respectively would be conducive!
P.p.s.: I noticed, that after Ctrl-A and in some lines highlighting till linefeed, Ctrl-C copies to clipboard more then just in Gui displayed text.

regards!

Re: Google and Dictionary Search

Posted: 18 Jun 2015, 18:31
by FanaticGuru
Updated Dictionary on First Page

Version: 1.2
Change Log: 2015-06-18


  • Remove unneeded information through Html DOM instead of using CSS to set to Display:none (Display:none still allowed the information to show up during Copy & Paste)
  • Added History, when Gui is active Left and Right Arrows go back and forth through history

It is worth noting that an HtmlFile does not seem to support getElementsByClassName so I added a function to walk through the DOM by getElementsByTagName and then checked those for the proper ClassName to remove then used child.parentNode.removeChild(child) to remove the unneeded nodes. I could have done it with a RegEx function but I wanted to figure out how to do it with DOM. I spent a good deal of time banging my head trying to make getElementsByClassName work trying ever way I could think of before I gave up on it.

Html DOM is great but tricky to figure out what all you can do as document objects, web browser objects, CSS, JavaScript etc. all flow together and overlap.

FG

Re: Google and Dictionary Search

Posted: 19 Jun 2015, 23:29
by rommmcek
Once again,

Brilliant, brilliant, brilliant!!!

Thank you so much FanaticGuru!

Re: Google and Dictionary Search

Posted: 06 Jul 2015, 11:07
by rommmcek
Hi, again!

Still enthusiastic about your Dictionary. One more question 'cause didn't 've profound study of your code yet.
Will it work forever? What if they change site conception?

Thank you, forever!

Re: Google and Dictionary Search

Posted: 06 Jul 2015, 12:41
by FanaticGuru
rommmcek wrote:Hi, again!

Still enthusiastic about your Dictionary. One more question 'cause didn't 've profound study of your code yet.
Will it work forever? What if they change site conception?

Thank you, forever!

The script depends on Dictionary.com to get the definitions. If the html code that site returns when a definition request is sent changes significantly then the script will need to be modified. The modifications should not be that difficult.

The script is one of my standard bootup scripts that is always running on my computer so I intent to keep it updated for the foreseeable future.

At some point when I get the time I would like to add a script that does a similar thing for thesaurus.com to display synonyms and antonyms.

FG

Re: Google and Dictionary Search

Posted: 06 Jul 2015, 14:50
by rommmcek
Thanks for prompt answer!
I'm running it all the time too! Unfortunately am I not on the line all the time.
Thrilling to see FG thesaurus.com
Hoping to comprehend tricks thoroughly soon!

bye!

Re: Google and Dictionary Search

Posted: 08 Mar 2016, 20:57
by rommmcek
That's what I was scared of! Dictionary doesn't work anymore.

I modified your editor like behavior for history and made saving it to file.
I added "Word origin" and <br> at the end, to show all content in every case.
I added "More suggestions" after "Did you mean ...?".
So at first I thought that my modifications were the reason.

But then even your original script responses with "NO results found on Dictionary.com" only.
Too bad!

Here is my Thesaurus.com based on modified Dictionary.ahk, with a bit uncommon and even inconsequent approach.
I think the site was easier to decipher and still works. (Probably wasn't modified yet!)

bye!

Edit: Update!

Re: Google and Dictionary Search

Posted: 09 Mar 2016, 21:04
by rommmcek
Adding s to RegExMatch seems to solve the problem!, so:

Code: [Select all] [Download] GeSHi © Codebox Plus

  if RegExMatch(Http_Text,"sU)(<div class=""center-well-container"".*)<div class=""source-meta"">", Section)
Section := Section1 "`n<br>"
works fine enough for me.

Edit: With this replace works better without -s option:

Code: [Select all] [Download] GeSHi © Codebox Plus

stringreplace, Http_Text, Http_Text, `r,, all

Re: Google and Dictionary Search

Posted: 10 Mar 2016, 03:35
by FanaticGuru
Updated Dictionary on First Page

Version: 1.21
Change Log: 2016-03-10


  • Added s flag to RegEx where need to accommodate for stray `n or `r in HTML code
  • Removed node that advertised Thesaurus.com

FG

Re: Google and Dictionary Search

Posted: 10 Mar 2016, 23:47
by rommmcek
Thank you FG, for a professional update!
I just got addicted to this great idea of yours!

Re: Google, Dictionary, Thesaurus Search

Posted: 15 Mar 2016, 12:19
by FanaticGuru
Updated Google on First Page

Version: 1.21
Change Log: 2016-03-15


  • Add Microsoft Edge as a possible browser default

Added Thesaurus on First Page

Version: 1.0
Change Log: 2016-03-15


  • Has a better gui than Dictionary that shows the word in a box at the top
  • Can {tab} to move to the box at top and enter new word

FG

Re: Google, Dictionary, Thesaurus Search

Posted: 16 Mar 2016, 04:36
by rommmcek
Awesome display style in Thesaurus Search!!!

Thanks!

P.s.: Why do you stick with this editor like history behavior?

Re: Google, Dictionary, Thesaurus Search

Posted: 17 Nov 2016, 08:06
by becritical
I can't see to get this to work, I get "failed attempt to launch program or document, action <http.......> params:<> the system cannot find the file specified and a pointer to line Run,%browser% %address% and I have checked the registry entry it is correct it points to firefoxURL

Re: Google, Dictionary, Thesaurus Search

Posted: 17 Nov 2016, 20:23
by FanaticGuru
becritical wrote:I can't see to get this to work, I get "failed attempt to launch program or document, action <http.......> params:<> the system cannot find the file specified and a pointer to line Run,%browser% %address% and I have checked the registry entry it is correct it points to firefoxURL

The script does Run, firefox.exe. Maybe you have Firefox installed somewhere that Windows is not able to find it.
This is the part that tries to figure out what the default browser is on the system.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

RegRead, ProgID, HKEY_CURRENT_USER, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice, Progid
Browser := "iexplore.exe"
if (ProgID = "ChromeHTML")
Browser := "chrome.exe"
if (ProgID = "FirefoxURL")
Browser := "firefox.exe"
if (ProgID = "AppXq0fevzme2pys62n3e0fbqa7peapykr8v")
Browser := "microsoft-edge:"

You might change the line Browser := "firefox.exe" to include the entire path to firefox.exe.

FG

Re: Google, Dictionary, Thesaurus Search

Posted: 01 Feb 2017, 07:22
by becritical
Thank you but I am not having any luck! I changed to the full path and also checked the windows registry exists and it's exact and it is FirefoxURL.
I still get the same message. "failed to lunch program...." Action: <http://www.google.com/search.... q=UserChoice"

RegRead, ProgId, HKEY_CURRENT_USER, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice, Progid
Browser := "iexplore.exe"
if (ProgID = "ChromeHTML")
Browser := "chrome.exe"
if (ProgID = "FirefoxURL")
Browser := "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
if (ProgID = "AppXq0fevzme2pys62n3e0fbqa7peapykr8v")
Browser := "microsoft-edge:

Any idea?


FanaticGuru wrote:
becritical wrote:I can't see to get this to work, I get "failed attempt to launch program or document, action <http.......> params:<> the system cannot find the file specified and a pointer to line Run,%browser% %address% and I have checked the registry entry it is correct it points to firefoxURL

The script does Run, firefox.exe. Maybe you have Firefox installed somewhere that Windows is not able to find it.
This is the part that tries to figure out what the default browser is on the system.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

RegRead, ProgID, HKEY_CURRENT_USER, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice, Progid
Browser := "iexplore.exe"
if (ProgID = "ChromeHTML")
Browser := "chrome.exe"
if (ProgID = "FirefoxURL")
Browser := "firefox.exe"
if (ProgID = "AppXq0fevzme2pys62n3e0fbqa7peapykr8v")
Browser := "microsoft-edge:"

You might change the line Browser := "firefox.exe" to include the entire path to firefox.exe.

FG