Thursday, January 11, 2018

AHK Script to translate segment with Google Translate in Across

#NoEnv
SendMode Input
^!I::
Send ^a
Sleep, 500
Send ^c
ClipWait, 2
google_url:="http://translate.google.com/#de/ro/" clipboard
Run %google_url%
Sleep, 2000
MouseMove 966, 297 ; replace with default mouse position for the window
Send ^c
Sleep, 500
Send ^w ; close tab in Firefox
Sleep, 500
StringCaseSense On
StringReplace, clipboard, clipboard, ș, ş, All ; replace new with old diacritics, if needed
StringReplace, clipboard, clipboard, Ș, Ş, All
StringReplace, clipboard, clipboard, ț, ţ, All
StringReplace, clipboard, clipboard, Ț, Ţ, All
WinActivate Across Translator Premium Edition v6.3 7557_en ; replace with current Across version
Sleep, 500
Send ^v
return