einfach mal als Aufgabe bei ChatGPT das eintippen: Create an Autohotkey program to input english text and transalate to german
auch mal 2-3 Versuche machen, es kommen verschiedene Lösungen raus...mal mit GoogleTransalator, mal MS...
beispiel vom autom. generierten code.
Code: Select all
#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.
; Press Ctrl+Shift+T to activate the script
^+t::
; Prompt the user to enter the English text to translate
InputBox, englishText, Translate to German, Enter the English text to translate:
if (englishText = "") ; If the user didn't enter any text, exit the script
return
; Use the built-in AutoHotkey COM object to call the Microsoft Translator API
translator := ComObjCreate("Microsoft.Translator")
; Translate the English text to German using the Microsoft Translator API
germanText := translator.Translate("en", "de", englishText)
; Display the translated German text in a message box
MsgBox, %germanText%
; Clean up the translator object
translator := ""
return