Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance force
- !f:: ; Look up word
- InputBox, UserInput, Enter a word to look up, The word entered here will be looked up in Denshi Jisho`, Space Alc`, Goo`, Sanseido and Tagaini Jisho.
- If (ErrorLevel = 0)
- {
- BlockInput, Mouse
- MouseGetPos, xpos, ypos, ActiveWindow
- SetTitleMatchMode 2
- IfWinExist Denshi Jisho
- {
- WinActivate
- }
- else
- IfWinExist on the WEB
- {
- WinActivate
- send ^1
- }
- else
- IfWinExist goo
- {
- WinActivate
- send ^1
- }
- else
- IfWinExist Web Dictionary
- {
- WinActivate
- send ^1
- }
- else
- {
- MsgBox, No dictionary was found in an active tab. Either activate a tab with a dictionary in or click alt+f to restart the browser and open the dictionaries.
- return
- }
- {
- sleep 200
- SetTitleMatchMode 2
- IfWinExist Find sentences - Denshi Jisho - Mozilla Firefox
- {
- WinActivate
- sleep 25
- send {Home}
- sleep 25
- click 188, 216
- sleep 100
- send ^a
- send {backspace}
- sleep 50
- send %UserInput%
- sleep 100
- send {enter}
- sleep 50
- send {enter}
- sleep 20
- send ^2
- sleep 25
- send {Home}
- sleep 25
- click 418, 355
- sleep 100
- send ^a
- send {backspace}
- sleep 50
- send %UserInput%
- sleep 100
- send {enter}
- sleep 50
- send {enter}
- sleep 20
- send ^3
- sleep 25
- send {Home}
- sleep 25
- click 552, 266
- sleep 100
- send ^a
- send {backspace}
- sleep 50
- send %UserInput%
- sleep 100
- send {enter}
- sleep 50
- send {enter}
- sleep 20
- send ^4
- sleep 25
- send {Home}
- sleep 25
- click 132, 322
- sleep 100
- send ^a
- send {backspace}
- sleep 50
- send %UserInput%
- sleep 100
- send {enter}
- sleep 50
- send {enter}
- sleep 20
- IfWinExist Tagaini Jisho
- {
- WinActivate
- sleep 50
- send ^l
- sleep 50
- send {backspace}
- sleep 50
- send %UserInput%{enter}
- WinActivate, ahk_id %ActiveWindow%
- MouseMove, %xpos%, %ypos%, 0
- return
- }
- Else
- {
- MsgBox, Error, Tagaini Jisho was not open, so the word couldn't be looked up.
- return
- }
- }
- Else
- {
- MsgBox, An active window with the name "Find sentences - Denshi Jisho - Mozilla Firefox" was not found.
- return
- }
- }
- }
- Else
- {
- MsgBox, Cancel was pressed.
- return
- }
- return
- !s:: ; Open dictionaries
- process, Exist, firefox.exe
- If (ErrorLevel = 0)
- {
- Run, firefox.exe, Max
- sleep 5000
- SetTitleMatchMode 2
- WinMaximize, Mozilla Firefox
- sleep 2500
- send !d
- sleep 50
- send http://jisho.org/sentences?jap=ue&eng=
- send {enter}
- sleep 50
- Run, http://eow.alc.co.jp/search?q=a
- sleep 50
- Run, http://dictionary.goo.ne.jp/srch/jn/a/m0u/tab/
- sleep 50
- Run, http://www.sanseido.net/User/Dic/Index.aspx?TWords=a&st=0&DORDER=151617&DailyJJ=checkbox&DailyEJ=checkbox&DailyJE=checkbox
- }
- Else
- {
- SetTitleMatchMode 2
- IfWinExist Denshi Jisho
- {
- MsgBox, 262144, Already opened, Denshi Jisho is already open.
- }
- else
- IfWinExist on the WEB
- {
- MsgBox, 262144, Already opened, Space Alc is already open.
- }
- else
- IfWinExist goo
- {
- MsgBox, 262144, Already opened, Goo is already open.
- }
- else
- IfWinExist Web Dictionary
- {
- MsgBox, 262144, Already opened, Sanseido is already open.
- }
- else
- {
- SetTitleMatchMode 2
- PostMessage, 0x112, 0xF060,,, Mozilla Firefox
- sleep 5000
- Run, firefox.exe, Max
- sleep 5000
- WinMaximize, Mozilla Firefox
- sleep 2500
- send !d
- send http://jisho.org/sentences?jap=ue&eng=
- send {enter}
- sleep 50
- Run, http://eow.alc.co.jp/search?q=a
- sleep 50
- Run, http://dictionary.goo.ne.jp/srch/jn/a/m0u/tab/
- sleep 50
- Run, http://www.sanseido.net/User/Dic/Index.aspx?TWords=a&st=0&DORDER=151617&DailyJJ=checkbox&DailyEJ=checkbox&DailyJE=checkbox
- }
- }
- {
- IfWinExist Tagaini Jisho
- {
- MsgBox, 262144, Already opened, Tagaini Jisho is already open.
- return
- }
- Else
- {
- Run D:\Tagaini Jisho\tagainijisho.exe
- return
- }
- }
- return
- !z:: ; insert kanji
- IfWinExist Add
- {
- BlockInput, on
- MouseGetPos, xpos, ypos, ActiveWindow
- send ^c
- WinActivate
- sleep 50
- click 100, 160
- sleep 50
- send ^v
- sleep 50
- SetTitleMatchMode 2
- WinActivate, ahk_id %ActiveWindow%
- MouseMove, %xpos%, %ypos%, 0
- BlockInput, off
- return
- }
- Else
- {
- MsgBox, Can't copy and paste because Anki isn't opened correctly
- return
- }
- return
- !x:: ; insert reading
- IfWinExist Add
- {
- BlockInput, on
- MouseGetPos, xpos, ypos, ActiveWindow
- send ^c
- WinActivate
- sleep 50
- click 100, 210
- sleep 50
- send ^v
- sleep 50
- SetTitleMatchMode 2
- WinActivate, ahk_id %ActiveWindow%
- MouseMove, %xpos%, %ypos%, 0
- BlockInput, off
- return
- }
- Else
- {
- MsgBox, Can't copy paste because Anki isn't opened correctly
- return
- }
- return
- !c:: ;insert example sentence
- IfWinExist Add
- {
- BlockInput, on
- MouseGetPos, xpos, ypos, ActiveWindow
- send ^c
- WinActivate
- sleep 50
- click 100, 250
- sleep 50
- send ^v
- sleep 50
- SetTitleMatchMode 2
- WinActivate, ahk_id %ActiveWindow%
- MouseMove, %xpos%, %ypos%, 0
- BlockInput, off
- return
- }
- Else
- {
- MsgBox, Can't copy paste because Anki isn't opened correctly
- return
- }
- return
- !v:: ;insert meaning
- IfWinExist Add
- {
- BlockInput, on
- MouseGetPos, xpos, ypos, ActiveWindow
- sleep 10
- send ^c
- WinActivate
- sleep 50
- click 100, 290
- sleep 50
- send ^v
- SetTitleMatchMode 2
- WinActivate, ahk_id %ActiveWindow%
- MouseMove, %xpos%, %ypos%, 0
- BlockInput, off
- return
- }
- Else
- {
- MsgBox, Can't copy paste because Anki isn't opened correctly
- return
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement