LoginSignup
6
5

More than 5 years have passed since last update.

どこからでも google 検索

Last updated at Posted at 2013-05-16

一日に繰り返し繰り返し
「ブラウザを開く」-->「google検索窓をクリック」-->「検索」
のような行動をしていると、積もり積もって結構な無駄になっている気がしていたので、
よく使う検索の手間を省く AutoHotKey スクリプトを書いた。

下の例では「無変換キー」+「1」で google 検索用のダイアログ、
「無変換キー」+「2」で weblio 検索用のダイアログが表示され、
エンターキーを押すと firefox の新しいタブで検索結果が表示される。

スペース区切りで複数ワード検索をできるようにテキスト整形をしたのがちょっと頑張ったところ。

; プログラムショートカット
; google search
vk1Dsc07B & 1::
    InputBox, sword, Google くん, , , , 130
    if ErrorLevel <> 0
    {}
    else
    {
        NewStr := RegExReplace(sword, "\s+", "\+")
        Sleep 100
        Run, "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab "http://www.google.co.jp/search?hl=ja&lr=lang_ja&ie=UTF-8&q=%sword%"
    }
    return

; weblio search
vk1Dsc07B & 2::
    InputBox, sword, Weblio くん, , , , 130
    if ErrorLevel <> 0
    {}
    else
    {
        NewStr := RegExReplace(sword, "\s+", "\+")
        Sleep 100
        Run, "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab "http://ejje.weblio.jp/content/%sword%"
    }
    return
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5