Hier meine Variante
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <IE.au3>
$Url = "http://translate.google.de/translate_t#"
GUICreate("Rapidtranslator by funkey", 400,120)
$Label = GUICtrlCreateLabel("Bitte zu übersetzenden Text eingeben!",10, 10, 380, 20)
$Input = GUICtrlCreateInput("",10,30, 380,20)
$Btn_de_en = GUICtrlCreateButton("Übersetzen DE -> EN", 10, 55, 170, 20)
$Btn_en_de = GUICtrlCreateButton("Übersetzen EN -> DE", 220, 55, 170, 20)
$warten = GUICtrlCreateLabel("Bitte warten",10, 80, 380, 20)
GUICtrlSetState( -1, $GUI_HIDE)
$result = GUICtrlCreateInput("",10, 80, 380, 20)
GUICtrlSetState( -1, $GUI_HIDE)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $Btn_de_en Then
$transdirection = "de|en|"
$Text = GUICtrlRead($Input)
If $Text <> "" Then
GUICtrlSetData($result, trans($transdirection))
EndIf
EndIf
If $msg = $Btn_en_de Then
$transdirection = "en|de|"
$Text = GUICtrlRead($Input)
If $Text <> "" Then
GUICtrlSetData($result, trans($transdirection))
EndIf
EndIf
Sleep(20)
WEnd
Func trans($langdirection)
GUICtrlSetState($warten, $GUI_SHOW)
GUICtrlSetState($result, $GUI_HIDE)
$oIE = _IECreate($Url&$transdirection&$Text,0,0,1)
$oform = _IEFormGetObjByName($oIE, 1)
$otext = _IEFormElementGetObjByName($oform , "gtrans")
Do
$translation = _IEFormElementGetValue($otext)
Until $translation <> ""
_IEQuit($oIE)
GUICtrlSetState($warten, $GUI_HIDE)
GUICtrlSetState($result, $GUI_SHOW)
Return $translation
EndFunc