I "made" a script to make looking up words very quick and painless

This is a AutoHotKey script for Windows that will bring up a search box with a shortcut combination. I realise browser extensions like Yomichan exist, but this is mostly to look up words from physical media and pictures. Thanks to ‘MacroMan!’ for writing the script! I grabbed the script from the bottom of this page. I simply rewrote it a bit to make the gui look nicer, and I removed the paste search button.

Capture

Usage:
Press Alt + F anywhere to bring up the interface. The search box is automatically selected, so just type away and hit enter, and it’ll bring up Jisho in a new tab of your web browser! The dropdown allows you to select from Jisho, Google, and DeepL. These can easily be edited to your choice as detailed later.

How To:

  1. Install AutoHotKey.

  2. Open up notepad (or text editor of choice) and copy+paste this code:

!f::
Gui, Add, Text, x4 y+3
Gui, Add, Edit, vEdit1 w250 x+18
Gui, Add, Button, default  x+4 gSubmit, Submit
Gui, Add, Text, x16 y30
Gui, Add, DropDownList, vEngineChoice w150 x+5 y30, Jisho||Google|DeepL
Gui, Show
return

Submit:
Gui, Submit
Gui, Destroy
IniRead, SearchWhere, sites.ini, sites, %EngineChoice%
StringReplace, Edit1, Edit1, %A_Space%, +, All
StringReplace, SearchWhere, SearchWhere, [searchterm], %Edit1%
run %SearchWhere%
return

GuiClose:
Gui, Destroy
  1. Save as search.ahk in C:\Users\[YOUR USERNAME HERE]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

  2. In the same folder, create another file called sites.ini and copy this code:

[sites]
Google=http://www.google.com/search?hl=en&safe=off&q=[searchterm]
Jisho=https://jisho.org/search/[searchterm]
DeepL=https://www.deepl.com/translator#ja/en/[searchterm]
  1. Double click the .ahk to run it, hit Alt + F, and there you go! If you saved it in the startup folder like I specified earlier, it should run everytime you boot Windows.

It’s worth noting you can’t have two running at the same time, so if you get an error saying ‘The same variable cannot be used for more than one control’, you already have a window open somewhere.

Customisation:

  • Changing search engines:
    You can add as many or as little search engines as you like.
  1. Open the .ahk in notepad.
  2. Go to the line with deepl||Google|Jisho in it, the || denotes the default search engine. Add a | and the name of your search engine to the end of the line. Save.
  3. Open the sites.ini
  4. Follow the example of the other search engines in the file. The search engine names here should match the engines in the ahk. Add [searchterm] where the search term would go; find this out by typing ‘test’ into your search engine, copy the url, and replace ‘test’ with [searchterm]. Save.
  5. Relaunch the .ahk
  • Changing shortcut key:
    In AutoHotKey, the ctrl, shift, and alt keys are represented with ^, !, +, respectively. So Ctrl + F would be ^F, Alt + G would be !G, etc, etc.
    The shortcut setting is at the top of the .ahk file. AutoHotKey details the various shortcuts you can utilise here.

Enjoy, and remember to utilise responsibly! Resist the urge to punch entire Japanese sentences into DeepL!

5 Likes

Awesome script.

I love AutoHotkey and use it all the time, although you may need to disable sometimes if you play games since some anti cheat software doesn’t like it.

Good point, that’s why I have this in my scripts file:
f12::Suspend,Toggle

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.