#include #include #include "Json.au3" ; (by @AspirinJunkie) #include #include Global $clip_memo = ClipGet() ; ------------ Function : --------------- Func _GoogleAPITranslate($sMytext, $sFrom, $sTo) Local $sUrl, $oHTTP, $sResponse, $JSONData, $sOutput = "", $aData $sUrl = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=" & $sFrom & "&tl=" & $sTo & "&dt=t&q=" & $sMytext $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("POST", $sUrl, False) $oHTTP.Send() $sResponse = $oHTTP.ResponseText $JSONData = _JSON_Parse($sResponse) If VarGetType($JSONData) = 'Array' Then $aData = $JSONData[0] If VarGetType($aData) = 'Array' Then For $i = 0 To UBound($aData) -1 Step 1 $sOutput &= ($aData[$i])[0] ;*** & @CRLF Next EndIf EndIf Return $sOutput EndFunc ;==>_GoogleAPITranslate Func Prepare_text($clip_get='') $v = StringLeft($clip_get, 1000) $v = StringRegExpReplace($v, '([^a-zA-Z]+)', ' ') ; --------> do it yourself :) If $v==' ' Then $v = '' return $v EndFunc Func Tool_tip_draw($v='', $bkcolor=Dec("000000"), $textcolor=Dec("FFFFFF")) Local $hFont = _WinAPI_CreateFont(30, 0) ; ---------> Create your Font: https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_CreateFont.htm ToolTip($v, -100, -100, Default, 0, 1) ; https://autoit-script.ru/docs/libfunctions/_winapi_createfont.htm Local $hWnd = WinGetHandle($v) If StringLen($v) <> 0 Then _WinAPI_SetWindowTheme($hWnd, "0", "0") _GUIToolTip_SetTipTextColor($hWnd, $textcolor) _GUIToolTip_SetTipBkColor($hWnd, $bkcolor) _WinAPI_SetFont($hWnd, $hFont) ToolTip($v, Default, Default, Default, 0, 1) While _IsPressed('01') and StringLen($v) <> 0 $pos = MouseGetPos() WinMove($hWnd, "", $pos[0]+15, $pos[1]+5) WEnd EndIf ClipPut($clip_memo) Sleep(10) _WinAPI_DeleteObject($hFont) EndFunc Func mouse_event() Do $x_mouse_pos = MouseGetPos(0) $y_mouse_pos = MouseGetPos(1) Sleep(75) Until Abs($x_mouse_pos-MouseGetPos(0)) == 0 and Abs($y_mouse_pos-MouseGetPos(1)) == 0 Return True EndFunc While 1 ; >>> START LOOP <<< ToolTip('') $clip_memo = ClipGet() Sleep(30) While _IsPressed('01') and mouse_event() Sleep(50) If Not _IsPressed('01')Or Not mouse_event() Then ExitLoop Sleep(50) If Not _IsPressed('01')Or Not mouse_event() Then ExitLoop Sleep(50) If Not _IsPressed('01')Or Not mouse_event() Then ExitLoop ClipPut('') Sleep(30) Send("^{INSERT}") Sleep(50) If Not _IsPressed('01')Or Not mouse_event() Then ClipPut($clip_memo) ExitLoop EndIf If StringRegExp(ClipGet(), "[A-Za-z]:\\[A-Za-z]+(\.|\\)[a-zA-Z]+|[A-Za-z]:\\", 0) Then ; c:/file.exe or c:/folder/folder... or c:/ ClipPut($clip_memo) ; В буфере обмена появляется когда перетаскиваешь файл или папку. ExitLoop EndIf Sleep(50) If Not _IsPressed('01')Or Not mouse_event() Then ClipPut($clip_memo) ExitLoop EndIf If Int(StringLen(Prepare_text(ClipGet()))) > 1 Then Beep(500, 50) ConsoleWrite('G') Tool_tip_draw(_GoogleAPITranslate(Prepare_text(ClipGet()), "auto", "ru")); choose for yourself: see below EndIf ClipPut($clip_memo) Sleep(30) WEnd WEnd ;~ LANGUAGES = { ;~ 'af': 'afrikaans', ;~ 'sq': 'albanian', ;~ 'am': 'amharic', ;~ 'ar': 'arabic', ;~ 'hy': 'armenian', ;~ 'az': 'azerbaijani', ;~ 'eu': 'basque', ;~ 'be': 'belarusian', ;~ 'bn': 'bengali', ;~ 'bs': 'bosnian', ;~ 'bg': 'bulgarian', ;~ 'ca': 'catalan', ;~ 'ceb': 'cebuano', ;~ 'ny': 'chichewa', ;~ 'zh-cn': 'chinese (simplified)', ;~ 'zh-tw': 'chinese (traditional)', ;~ 'co': 'corsican', ;~ 'hr': 'croatian', ;~ 'cs': 'czech', ;~ 'da': 'danish', ;~ 'nl': 'dutch', ;~ 'en': 'english', ;~ 'eo': 'esperanto', ;~ 'et': 'estonian', ;~ 'tl': 'filipino', ;~ 'fi': 'finnish', ;~ 'fr': 'french', ;~ 'fy': 'frisian', ;~ 'gl': 'galician', ;~ 'ka': 'georgian', ;~ 'de': 'german', ;~ 'el': 'greek', ;~ 'gu': 'gujarati', ;~ 'ht': 'haitian creole', ;~ 'ha': 'hausa', ;~ 'haw': 'hawaiian', ;~ 'iw': 'hebrew', ;~ 'he': 'hebrew', ;~ 'hi': 'hindi', ;~ 'hmn': 'hmong', ;~ 'hu': 'hungarian', ;~ 'is': 'icelandic', ;~ 'ig': 'igbo', ;~ 'id': 'indonesian', ;~ 'ga': 'irish', ;~ 'it': 'italian', ;~ 'ja': 'japanese', ;~ 'jw': 'javanese', ;~ 'kn': 'kannada', ;~ 'kk': 'kazakh', ;~ 'km': 'khmer', ;~ 'ko': 'korean', ;~ 'ku': 'kurdish (kurmanji)', ;~ 'ky': 'kyrgyz', ;~ 'lo': 'lao', ;~ 'la': 'latin', ;~ 'lv': 'latvian', ;~ 'lt': 'lithuanian', ;~ 'lb': 'luxembourgish', ;~ 'mk': 'macedonian', ;~ 'mg': 'malagasy', ;~ 'ms': 'malay', ;~ 'ml': 'malayalam', ;~ 'mt': 'maltese', ;~ 'mi': 'maori', ;~ 'mr': 'marathi', ;~ 'mn': 'mongolian', ;~ 'my': 'myanmar (burmese)', ;~ 'ne': 'nepali', ;~ 'no': 'norwegian', ;~ 'or': 'odia', ;~ 'ps': 'pashto', ;~ 'fa': 'persian', ;~ 'pl': 'polish', ;~ 'pt': 'portuguese', ;~ 'pa': 'punjabi', ;~ 'ro': 'romanian', ;~ 'ru': 'russian', ;~ 'sm': 'samoan', ;~ 'gd': 'scots gaelic', ;~ 'sr': 'serbian', ;~ 'st': 'sesotho', ;~ 'sn': 'shona', ;~ 'sd': 'sindhi', ;~ 'si': 'sinhala', ;~ 'sk': 'slovak', ;~ 'sl': 'slovenian', ;~ 'so': 'somali', ;~ 'es': 'spanish', ;~ 'su': 'sundanese', ;~ 'sw': 'swahili', ;~ 'sv': 'swedish', ;~ 'tg': 'tajik', ;~ 'ta': 'tamil', ;~ 'te': 'telugu', ;~ 'th': 'thai', ;~ 'tr': 'turkish', ;~ 'uk': 'ukrainian', ;~ 'ur': 'urdu', ;~ 'ug': 'uyghur', ;~ 'uz': 'uzbek', ;~ 'vi': 'vietnamese', ;~ 'cy': 'welsh', ;~ 'xh': 'xhosa', ;~ 'yi': 'yiddish', ;~ 'yo': 'yoruba', ;~ 'zu': 'zulu',