0

I have set up hot keys to let me highlight a word in a foreign language(FR, SP, GE) and based on the hotkey I can either conjugate it, hear a human pronounce it, or define it in context. However the site that I want to use to conjugate German verbs does not submit the word in the url. I like this conjugator the best: https://deutsch.lingolia.com/en/grammar/conjugator and I don't know much about Jquery nor about how hotkeys could be used to submit a verb in the form data on this page. Does anyone know if this is possible? There are many conjugators that I could use the URL method, but I want to use this site.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#f::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/fr""
Return
#g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/de/""
Return
#s::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/es/""
Return

#!f::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
;MsgBox, %totranslate% = %clipboard%
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/french-english/"%totranslate%"
Return

#!g::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/german-english/"%totranslate%"
Return

#!s::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/spanish-english/"%totranslate%"
Return

+#g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.verbix.com/webverbix/German/"%clipboard%".html""
Return

+#f::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.collinsdictionary.com/dictionary/french-english/conjugation/"%clipboard%"
Return

+#s::
clipboard=
send, ^c
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.spanishdict.com/conjugate/"%clipboard%"
Return

#+!g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""https://en.wiktionary.org/wiki/"%clipboard%"#Declension""
Return

1 Answers1

1

You could mimic the way that a human would use the website:

+#s::
clipboard=
send, ^c
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://deutsch.lingolia.com/en/grammar/conjugator"

WinWait, Conjugate German Verbs - Lingolia German - Google Chrome, 
IfWinNotActive, Conjugate German Verbs - Lingolia German - Google Chrome, , WinActivate, Conjugate German Verbs - Lingolia German - Google Chrome, 
WinWaitActive, Conjugate German Verbs - Lingolia German - Google Chrome, 
MouseClick, left,  460,  399
Sleep, 100
Send, {TAB}{CTRLDOWN}v{CTRLUP}{ENTER}


Return
Sir Adelaide
  • 4,977
  • 2
  • 16
  • 36