Advertisement
Guest User

Untitled

a guest
Dec 18th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance force
  2.  
  3. !f:: ; Look up word
  4. 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.
  5. If (ErrorLevel = 0)
  6. {
  7.     BlockInput, Mouse
  8.     MouseGetPos, xpos, ypos, ActiveWindow
  9.     SetTitleMatchMode 2
  10.     IfWinExist Denshi Jisho
  11.     {
  12.         WinActivate
  13.     }
  14.     else
  15.     IfWinExist on the WEB
  16.     {
  17.         WinActivate
  18.         send ^1
  19.     }
  20.     else
  21.     IfWinExist goo
  22.     {
  23.         WinActivate
  24.         send ^1
  25.     }
  26.     else
  27.     IfWinExist Web Dictionary
  28.     {
  29.         WinActivate
  30.         send ^1
  31.     }
  32.     else
  33.     {
  34.         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.
  35.         return
  36.     }
  37.     {
  38.         sleep 200
  39.         SetTitleMatchMode 2
  40.         IfWinExist Find sentences - Denshi Jisho - Mozilla Firefox
  41.         {
  42.             WinActivate
  43.             sleep 25
  44.             send {Home}
  45.             sleep 25
  46.             click 188, 216
  47.             sleep 100
  48.             send ^a
  49.             send {backspace}
  50.             sleep 50
  51.             send %UserInput%
  52.             sleep 100
  53.             send {enter}
  54.             sleep 50
  55.             send {enter}
  56.             sleep 20
  57.            
  58.             send ^2
  59.             sleep 25
  60.             send {Home}
  61.             sleep 25
  62.             click 418, 355
  63.             sleep 100
  64.             send ^a
  65.             send {backspace}
  66.             sleep 50
  67.             send %UserInput%
  68.             sleep 100
  69.             send {enter}
  70.             sleep 50
  71.             send {enter}
  72.             sleep 20
  73.            
  74.             send ^3
  75.             sleep 25
  76.             send {Home}
  77.             sleep 25
  78.             click 552, 266
  79.             sleep 100
  80.             send ^a
  81.             send {backspace}
  82.             sleep 50
  83.             send %UserInput%
  84.             sleep 100
  85.             send {enter}
  86.             sleep 50
  87.             send {enter}
  88.             sleep 20
  89.            
  90.             send ^4
  91.             sleep 25
  92.             send {Home}
  93.             sleep 25
  94.             click 132, 322
  95.             sleep 100
  96.             send ^a
  97.             send {backspace}
  98.             sleep 50
  99.             send %UserInput%
  100.             sleep 100
  101.             send {enter}
  102.             sleep 50
  103.             send {enter}
  104.             sleep 20
  105.                
  106.             IfWinExist Tagaini Jisho
  107.             {
  108.                 WinActivate
  109.                 sleep 50
  110.                 send ^l
  111.                 sleep 50
  112.                 send {backspace}
  113.                 sleep 50
  114.                 send %UserInput%{enter}
  115.                 WinActivate, ahk_id %ActiveWindow%
  116.                 MouseMove, %xpos%, %ypos%, 0
  117.                 return
  118.             }
  119.             Else
  120.             {
  121.                
  122.                 MsgBox, Error, Tagaini Jisho was not open, so the word couldn't be looked up.
  123.                 return
  124.             }
  125.         }
  126.         Else
  127.         {
  128.             MsgBox, An active window with the name "Find sentences - Denshi Jisho - Mozilla Firefox" was not found.
  129.             return
  130.         }
  131.     }
  132. }
  133. Else
  134. {
  135.     MsgBox, Cancel was pressed.
  136.     return
  137. }
  138. return
  139.  
  140.  
  141. !s:: ; Open dictionaries
  142. process, Exist, firefox.exe
  143. If (ErrorLevel = 0)
  144. {
  145.     Run, firefox.exe, Max
  146.     sleep 5000
  147.     SetTitleMatchMode 2
  148.     WinMaximize, Mozilla Firefox
  149.     sleep 2500
  150.     send !d
  151.     sleep 50
  152.     send http://jisho.org/sentences?jap=ue&eng=
  153.     send {enter}
  154.     sleep 50
  155.     Run,  http://eow.alc.co.jp/search?q=a
  156.     sleep 50
  157.     Run, http://dictionary.goo.ne.jp/srch/jn/a/m0u/tab/
  158.     sleep 50
  159.     Run, http://www.sanseido.net/User/Dic/Index.aspx?TWords=a&st=0&DORDER=151617&DailyJJ=checkbox&DailyEJ=checkbox&DailyJE=checkbox
  160. }
  161. Else
  162. {
  163.     SetTitleMatchMode 2
  164.     IfWinExist Denshi Jisho
  165.     {
  166.         MsgBox, 262144, Already opened, Denshi Jisho is already open.
  167.     }
  168.     else
  169.     IfWinExist on the WEB
  170.     {
  171.         MsgBox, 262144, Already opened, Space Alc is already open.
  172.     }
  173.     else
  174.     IfWinExist goo
  175.     {
  176.         MsgBox, 262144, Already opened, Goo is already open.
  177.     }
  178.     else
  179.     IfWinExist Web Dictionary
  180.     {
  181.         MsgBox, 262144, Already opened, Sanseido is already open.
  182.     }
  183.     else
  184.     {
  185.         SetTitleMatchMode 2
  186.         PostMessage, 0x112, 0xF060,,, Mozilla Firefox
  187.         sleep 5000
  188.         Run, firefox.exe, Max
  189.         sleep 5000
  190.         WinMaximize, Mozilla Firefox
  191.         sleep 2500
  192.         send !d
  193.         send http://jisho.org/sentences?jap=ue&eng=
  194.         send {enter}
  195.         sleep 50
  196.         Run,  http://eow.alc.co.jp/search?q=a
  197.         sleep 50
  198.         Run, http://dictionary.goo.ne.jp/srch/jn/a/m0u/tab/
  199.         sleep 50
  200.         Run, http://www.sanseido.net/User/Dic/Index.aspx?TWords=a&st=0&DORDER=151617&DailyJJ=checkbox&DailyEJ=checkbox&DailyJE=checkbox
  201.     }
  202. }
  203. {
  204.     IfWinExist Tagaini Jisho
  205.     {
  206.         MsgBox, 262144, Already opened, Tagaini Jisho is already open.
  207.         return 
  208.     }  
  209.     Else
  210.     {
  211.         Run D:\Tagaini Jisho\tagainijisho.exe
  212.         return
  213.     }
  214. }
  215. return
  216.  
  217. !z:: ; insert kanji
  218. IfWinExist Add
  219. {
  220.     BlockInput, on
  221.     MouseGetPos, xpos, ypos, ActiveWindow
  222.     send ^c
  223.     WinActivate
  224.     sleep 50
  225.     click 100, 160
  226.     sleep 50
  227.     send ^v
  228.     sleep 50
  229.     SetTitleMatchMode 2
  230.     WinActivate, ahk_id %ActiveWindow%
  231.     MouseMove, %xpos%, %ypos%, 0
  232.     BlockInput, off
  233.     return
  234. }
  235. Else
  236. {
  237.     MsgBox, Can't copy and paste because Anki isn't opened correctly
  238.     return
  239. }
  240. return
  241.  
  242. !x:: ; insert reading
  243. IfWinExist Add
  244. {
  245.     BlockInput, on
  246.     MouseGetPos, xpos, ypos, ActiveWindow
  247.     send ^c
  248.     WinActivate
  249.     sleep 50
  250.     click 100, 210
  251.     sleep 50
  252.     send ^v
  253.     sleep 50
  254.     SetTitleMatchMode 2
  255.     WinActivate, ahk_id %ActiveWindow%
  256.     MouseMove, %xpos%, %ypos%, 0
  257.     BlockInput, off
  258.     return
  259. }
  260. Else
  261. {
  262.     MsgBox, Can't copy paste because Anki isn't opened correctly
  263.     return
  264. }
  265. return
  266.  
  267. !c:: ;insert example sentence
  268. IfWinExist Add
  269. {
  270.     BlockInput, on
  271.     MouseGetPos, xpos, ypos, ActiveWindow
  272.     send ^c
  273.     WinActivate
  274.     sleep 50
  275.     click 100, 250
  276.     sleep 50
  277.     send ^v
  278.     sleep 50
  279.     SetTitleMatchMode 2
  280.     WinActivate, ahk_id %ActiveWindow%
  281.     MouseMove, %xpos%, %ypos%, 0
  282.     BlockInput, off
  283.     return
  284. }
  285. Else
  286. {
  287.     MsgBox, Can't copy paste because Anki isn't opened correctly
  288.     return
  289. }
  290. return
  291.  
  292. !v:: ;insert meaning
  293. IfWinExist Add
  294. {
  295.     BlockInput, on
  296.     MouseGetPos, xpos, ypos, ActiveWindow
  297.     sleep 10
  298.     send ^c
  299.     WinActivate
  300.     sleep 50
  301.     click 100, 290
  302.     sleep 50
  303.     send ^v
  304.     SetTitleMatchMode 2
  305.     WinActivate, ahk_id %ActiveWindow%
  306.     MouseMove, %xpos%, %ypos%, 0
  307.     BlockInput, off
  308.     return
  309. }
  310. Else
  311. {
  312.     MsgBox, Can't copy paste because Anki isn't opened correctly
  313.     return
  314. }
  315. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement