Jump to content

Deye

Active Members
  • Posts

    893
  • Joined

  • Days Won

    1

Deye last won the day on January 25 2020

Deye had the most liked content!

1 Follower

Recent Profile Visitors

1,689 profile views

Deye's Achievements

  1. This is the method that I would employ. For $x = 1 To $arrayTwo[0][0] If _ArraySearch($arrayOne, $arrayTwo[$x][1], 0, 0, 0, 0, 1, 1) * -1 > 0 Then MsgBox(0, "", "Not Found element " & $arrayTwo[$x][1] & " in $arrayOne") EndIf Next
  2. anyone know of a way to get suggested text "showing translations for" or, on the right, "Did you mean" <span class="mvqA2c" jsaction ...
  3. some sort of approach or plan Func IsArrayEmpty($array, $STR_NOCOUNT = Default) ; Default = False ; consider (0 row) an array element Return UBound(StringRegExp(StringStripWS(_ArrayToString($array, "|", ($STR_NOCOUNT ? 1 : Default)), 8), "[^|]+\|", 3)) EndFunc
  4. In order to see if it works, try using the right delimiter, such as ", " <- holds a space there. You can then refine the code by modifying it to something along the lines of "[" & $sDelim & "][" & $sDelim & "]" to achieve the desired outcome. (maybe maybe) then anyone interested in conducting their own experiments to discover a solution that fits their specific needs could use this example as a jumping-off point. This is not exactly breaking news, as we know
  5. apologies, but in order to try your hand at this function fairly , you must pass the correct arguments, especially the delimiter being used. like so,  _Deye_ArrayDelEmptyRows($aArray, Chr(34)) or _Deye_ArrayDelEmptyRows($aArray, '"')
  6. AspirinJunkie, This function relies on the user using the correct delimiter Chr(34)
  7. as a note: If you want faster execution, you may need to give up memory efficiency or make the code structure more complex. By carefully evaluating and prioritizing these trade-offs, it's crucial to thoroughly assess different strategies before implementing them. This involves carefully considering potential challenges, time constraints, organizing code, and ensuring compatibility with existing systems to address future issues smoothly. Func _Deye_ArrayDelEmptyRows(ByRef $aArray, $sDelim = Chr(32), $bUBound = False) Local $iArrayColumns = UBound($aArray, 2) If $iArrayColumns >= 1 Then Local $iCopyTo_Index = 0 For $i = 0 To UBound($aArray) - 1 For $j = 0 To $iArrayColumns - 1 ;~ If StringStripWS($aArray[$i][$j], 8) Then ExitLoop If $aArray[$i][$j] Then ExitLoop If $j = $iArrayColumns - 1 Then ContinueLoop 2 Next If $i <> $iCopyTo_Index Then For $j = 0 To $iArrayColumns - 1 $aArray[$iCopyTo_Index][$j] = $aArray[$i][$j] Next EndIf $iCopyTo_Index += 1 Next If UBound($aArray) > $iCopyTo_Index Then ReDim $aArray[$iCopyTo_Index][$iArrayColumns] If $bUBound Then _ArrayInsert($aArray, 0, UBound($aArray)) Return ($aArray) Else Return StringSplit(StringTrimLeft(StringRegExpReplace(StringRegExpReplace($sDelim & _ArrayToString($aArray, $sDelim), $sDelim & "[" & $sDelim & "]*[" & $sDelim & "]", $sDelim), $sDelim & "$", ""), 1), $sDelim, $bUBound ? "" : 3) EndIf EndFunc
  8. Would I need to recreate the image and use OCR (Optical Character Recognition) to maintain the text's general position if I wanted to downscale the image while keeping the text sharp? , then how would you go about doing so ,as we know on regular resize, the text gets smaller and blurred As illustrated in the small image, the text bleeds when zooming in. later i would try to remove marks-ups keeping only the text at the general position image.zip
  9. Not figure out yet , any help with this will be great Thank you #include <WinAPIShellEx.au3> #include <GDIPlus.au3> ShellExecute(ImageTOGreyscale("image.jpg")) Func ImageTOGreyscale($img) _GDIPlus_Startup() Local $hIA = _GDIPlus_ImageAttributesCreate() ;create an ImageAttribute object Local $tColorMatrix = _GDIPlus_ColorMatrixCreateGrayScale() ;create grayscale color matrix _GDIPlus_ImageAttributesSetColorMatrix($hIA, 4, True, $tColorMatrix, 1) ;set negative color matrix Local $hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptFullPath & "\" & $img) $ext = StringRegExpReplace($img, "^.*\.", "") $file = StringRegExpReplace(@ScriptFullPath, "(^.*\\)(.*)", "\1") & "img_grey." & $ext ;~ ClipPut($file) ;~ MsgBox(0, '', $file) $sCLSID = _GDIPlus_EncodersGetCLSID($ext) MsgBox(0, 'creating img_grey.' & $ext, _GDIPlus_ImageSaveToFileEx($hImage1, $file, $sCLSID)) _GDIPlus_ImageAttributesDispose($hIA) _GDIPlus_ImageDispose($hImage1) _GDIPlus_Shutdown() Return $file EndFunc ;==>ImageTOGreyscale
  10. small illustration to cap #include <WinAPISysWin.au3> ;include directory #include <Misc.au3> #include <Array.au3> Local $hDLL = DllOpen("user32.dll") OnAutoItExitRegister("Terminate") HotKeySet("{ESC}", "Terminate") HotKeySet("!z", "Clip") ;Alt Z While 1 Sleep(10) WEnd Func Clip() If _IsPressed("10", $hDLL) Then ; Wait until key is released. While _IsPressed("12 ", $hDLL) Sleep(250) WEnd EndIf Sleep(250) Send("^c") $hWnd = WinGetHandle("") ;~ highlight + right click (highlighted verb_phrase to Put in effect) ;~ Before initiating key combo Please highlight a designated command to carry out--> ;~ _WinAPI_GetClassName($hWnd) = "SciTEWindow" ;~ _WinAPI_GetWindowText ( $hWnd ) ; _WinAPI_GetClientHeight ( $hWnd ) $clip = ClipGet() $ret = Execute($clip) MsgBox("", '', $ret) EndFunc Func Terminate() DllClose($hDLL) Exit EndFunc
  11. is there something in the way HotKeySet is forcing combo keys it seems when i keep the alt key down after the first combo which errors with a windows chime, the dog naps on the second HotKeySet("{ESC}", "Terminate") HotKeySet("!z", "Clip") ;Alt Z While 1 Sleep(10) WEnd Func Clip() Send("^c") Do Sleep(50) $clip = ClipGet() Until @error <> 4 Or @error <> 3 ConsoleWrite($clip & @LF) EndFunc Func Terminate() Exit EndFunc
  12. #include <Array.au3> Dim $aArray[][] = [["A", 0], ["B", 0], ["C", 0], ["D", 0], ["E", 1], ["F", 1]] _ArrayDisplay(_ArrPopToTop($aArray, "B|D|F")) _ArrayDisplay(_ArrPopToTop($aArray, "D|E")) _ArrayDisplay(_ArrPopToTop($aArray, "C")) Func _ArrPopToTop($a, $val = "", $index = 0) Local $asplit = StringSplit($val, "|", 3) _ArrayReverse($asplit) For $j = 0 To UBound($asplit) - 1 $x = _ArraySearch($a, $asplit[$j], "", "", "", 0) _ArrayInsert($a, $index, _ArrayExtract($a, $x, $x)) _ArrayDelete($a, $x + 1) Next Return $a EndFunc
  13. the objective is to highlight text, and when you change the keyboard to another language, the text is translated from the previous keboard setting language to the current keboard language. but it seems hard to get anything done. #include <Array.au3> #include <WinAPISys.au3> HotKeySet("{ESC}", "Terminate") Local $var = '' & 'Hex|Dec|Country' & @LF & '0004|4|zh-CHS' & @LF & '0401|1025|ar-SA' & @LF & '0402|1026|bg-BG' & @LF & '0403|1027|ca-ES' & @LF & '0404|1028|zh-TW' & @LF & '0405|1029|cs-CZ' & @LF & '0406|1030|da-DK' & @LF & '0407|1031|de-DE' & @LF & '0408|1032|el-GR' & @LF & '0409|1033|en-US' & @LF & '040A|1034|es-ES_tradnl' & @LF & '040B|1035|fi-FI' & @LF & '040C|1036|fr-FR' & @LF & '040D|1037|he-IL' & @LF & '040E|1038|hu-HU' & @LF & '040F|1039|is-IS' & @LF & '0410|1040|it-IT' & @LF & '0411|1041|ja-JP' & @LF & '0412|1042|ko-KR' & @LF & '0413|1043|nl-NL' & @LF & '0414|1044|nb-NO' & @LF & '0415|1045|pl-PL' & @LF & '0416|1046|pt-BR' & @LF & '0417|1047|rm-CH' & @LF & '0418|1048|ro-RO' & @LF & '0419|1049|ru-RU' & @LF & '041A|1050|hr-HR' & @LF & '041B|1051|sk-SK' & @LF & '041C|1052|sq-AL' & @LF & '041D|1053|sv-SE' & @LF & '041E|1054|th-TH' & @LF & '041F|1055|tr-TR' & @LF & '0420|1056|ur-PK' & @LF & '0421|1057|id-ID' & @LF & '0422|1058|uk-UA' & @LF & '0423|1059|be-BY' & @LF & '0424|1060|sl-SI' & @LF & '0425|1061|et-EE' & @LF & '0426|1062|lv-LV' & @LF & '0427|1063|lt-LT' & @LF & '0428|1064|tg-Cyr' & @LF & '0429|1065|fa-IR' & @LF & '042A|1066|vi-VN' & @LF & '042B|1067|hy-AM' & @LF & '042C|1068|az-Lat' & @LF & '042D|1069|eu-ES' & @LF & '042E|1070|hsb-DE' & @LF & '042F|1071|mk-MK' & @LF & '0432|1074|tn-ZA' & @LF & '0434|1076|xh-ZA' & @LF & '0435|1077|zu-ZA' & @LF & '0436|1078|af-ZA' & @LF & '0437|1079|ka-GE' & @LF & '0438|1080|fo-FO' & @LF & '0439|1081|hi-IN' & @LF & '043A|1082|mt-MT' & @LF & '043B|1083|se-NO' & @LF & '043e|1086|ms-MY' & @LF & '043F|1087|kk-KZ' & @LF & '0440|1088|ky-KG' & @LF & '0441|1089|sw-KE' & @LF & '0442|1090|tk-TM' & @LF & '0443|1091|uz-Lat' & @LF & '0444|1092|tt-RU' & @LF & '0445|1093|bn-IN' & @LF & '0446|1094|pa-IN' & @LF & '0447|1095|gu-IN' & @LF & '0448|1096|or-IN' & @LF & '0449|1097|ta-IN' & @LF & '044A|1098|te-IN' & @LF & '044B|1099|kn-IN' & @LF & '044C|1100|ml-IN' & @LF & '044D|1101|as-IN' & @LF & '044E|1102|mr-IN' & @LF & '044F|1103|sa-IN' & @LF & '0450|1104|mn-MN' & @LF & '0451|1105|bo-CN' & @LF & '0452|1106|cy-GB' & @LF & '0453|1107|km-KH' & @LF & '0454|1108|lo-LA' & @LF & '0456|1110|gl-ES' & @LF & '0457|1111|kok-IN' & @LF & '0459|1113|sd-Dev' & @LF & '045A|1114|syr-SY' & @LF & '045B|1115|si-LK' & @LF & '045C|1116|chr-Che' & @LF & '045D|1117|iu-Can' & @LF & '045E|1118|am-ET' & @LF & '0461|1121|ne-NP' & @LF & '0462|1122|fy-NL' & @LF & '0463|1123|ps-AF' & @LF & '0464|1124|fil-PH' & @LF & '0465|1125|dv-MV' & @LF & '0468|1128|ha-Lat' & @LF & '046A|1130|yo-NG' & @LF & '046B|1131|quz-BO' & @LF & '046C|1132|nso-ZA' & @LF & '046D|1133|ba-RU' & @LF & '046E|1134|lb-LU' & @LF & '046F|1135|kl-GL' & @LF & '0470|1136|ig-NG' & @LF & '0473|1139|ti-ET' & @LF & '0475|1141|haw-US' & @LF & '0478|1144|ii-CN' & @LF & '047A|1146|arn-CL' & @LF & '047C|1148|moh-CA' & @LF & '047E|1150|br-FR' & @LF & '0480|1152|ug-CN' & @LF & '0481|1153|mi-NZ' & @LF & '0482|1154|oc-FR' & @LF & '0483|1155|co-FR' & @LF & '0484|1156|gsw-FR' & @LF & '0485|1157|sah-RU' & @LF & '0486|1158|quc-Lat' & @LF & '0487|1159|rw-RW' & @LF & '0488|1160|wo-SN' & @LF & '048C|1164|prs-AF' & @LF & '0491|1169|gd-GB' & @LF & '0492|1170|ku-Ara' & @LF & '0801|2049|ar-IQ' & @LF & '0803|2051|ca-E' & @LF & '0804|2052|zh-CN' & @LF & '0807|2055|de-CH' & @LF & '0809|2057|en-GB' & @LF & '080A|2058|es-MX' & @LF & '080C|2060|fr-BE' & @LF & '0810|2064|it-CH' & @LF & '0813|2067|nl-BE' & @LF & '0814|2068|nn-NO' & @LF & '0816|2070|pt-PT' & @LF & '081A|2074|sr-Lat' & @LF & '081D|2077|sv-FI' & @LF & '0820|2080|ur-IN' & @LF & '082C|2092|az-Cyr' & @LF & '082E|2094|dsb-DE' & @LF & '0832|2098|tn-BW' & @LF & '083B|2107|se-SE' & @LF & '083C|2108|ga-IE' & @LF & '083E|2110|ms-BN' & @LF & '0843|2115|uz-Cyr' & @LF & '0845|2117|bn-BD' & @LF & '0846|2118|pa-Ara' & @LF & '0849|2121|ta-LK' & @LF & '0850|2128|mn-Mon' & @LF & '0859|2137|sd-Ara' & @LF & '085D|2141|iu-Lat' & @LF & '085F|2143|tzm-Lat' & @LF & '0867|2151|ff-Lat' & @LF & '086B|2155|quz-EC' & @LF & '0873|2163|ti-ER' & @LF & '0873|2163|ti-ER' & @LF & '0C01|3073|ar-EG' & @LF & '0C04|3076|zh-HK' & @LF & '0C07|3079|de-AT' _ & @LF & '0C09|3081|en-AU' & @LF & '0C0A|3082|es-ES' & @LF & '0C0C|3084|fr-CA' & @LF & '0C1A|3098|sr-Cyr' & @LF & '0C3B|3131|se-FI' & @LF & '0C6B|3179|quz-PE' & @LF & '1001|4097|ar-LY' & @LF & '1004|4100|zh-SG' & @LF & '1007|4103|de-LU' & @LF & '1009|4105|en-CA' & @LF & '100A|4106|es-GT' & @LF & '100C|4108|fr-CH' & @LF & '101A|4122|hr-BA' & @LF & '103B|4155|smj-NO' & @LF & '105F|4191|tzm-Tfn' & @LF & '1401|5121|ar-DZ' & @LF & '1404|5124|zh-MO' & @LF & '1407|5127|de-LI' & @LF & '1409|5129|en-NZ' & @LF & '140A|5130|es-CR' & @LF & '140C|5132|fr-LU' & @LF & '141A|5146|bs-Lat' & @LF & '143B|5179|smj-SE' & @LF & '1801|6145|ar-MA' & @LF & '1809|6153|en-IE' & @LF & '180A|6154|es-PA' & @LF & '180C|6156|fr-MC' & @LF & '181A|6170|sr-Lat' & @LF & '183B|6203|sma-NO' & @LF & '1C01|7169|ar-TN' & @LF & '1c09|7177|en-ZA' & @LF & '1C0A|7178|es-DO' & @LF & '1C1A|7194|sr-Cyr' & @LF & '1C3B|7227|sma-SE' & @LF & '2001|8193|ar-OM' & @LF & '2009|8201|en-JM' & @LF & '200A|8202|es-VE' & @LF & '201A|8218|bs-Cyr' & @LF & '203B|8251|sms-FI' & @LF & '2401|9217|ar-YE' & @LF & '2409|9225|en-029' & @LF & '240A|9226|es-CO' & @LF & '241A|9242|sr-Lat' & @LF & '243B|9275|smn-FI' & @LF & '2801|10241|ar-SY' & @LF & '2809|10249|en-BZ' & @LF & '280A|10250|es-PE' & @LF & '281A|10266|sr-Cyr' & @LF & '2C01|11265|ar-JO' & @LF & '2C09|11273|en-TT' & @LF & '2C0A|11274|es-AR' & @LF & '2C1A|11290|sr-Lat' & @LF & '3001|12289|ar-LB' & @LF & '3009|12297|en-ZW' & @LF & '300A|12298|es-EC' & @LF & '301A|12314|sr-Cyr' & @LF & '3401|13313|ar-KW' & @LF & '3409|13321|en-PH' & @LF & '340A|13322|es-CL' & @LF & '3801|14337|ar-AE' & @LF & '380A|14346|es-UY' & @LF & '3C01|15361|ar-BH' & @LF & '3C0A|15370|es-PY' & @LF & '4001|16385|ar-QA' & @LF & '4009|16393|en-IN' & @LF & '400A|16394|es-BO' & @LF & '4409|17417|en-MY' & @LF & '440A|17418|es-SV' & @LF & '4809|18441|en-SG' & @LF & '480A|18442|es-HN' & @LF & '4C0A|19466|es-NI' & @LF & '500A|20490|es-PR' $sCommand = 'StringRegExpReplace($arr[_ArraySearch($arr,StringRight(@KBLayout, 4))][2], "\-(.*)", "")' Local $arr[0][3] _ArrayAdd($arr, $var, 0, "|", @LF) HotKeySet("!z", "ClipMessage") ; goes to function ;~ HotKeySet("!+", "ClipMessage") ; desired way = fails While 1 Sleep(10) WEnd Func ClipMessage() ;~ use alt + shift intermittently (test starting the script with different keboard sets.) Local Static $KBLayout = Execute($sCommand) Local $KBLayoutNew = Execute($sCommand) ConsoleWrite($KBLayout & @LF) ConsoleWrite( $KBLayoutNew & @LF) EndFunc Func Terminate() Exit EndFunc
  14. Any ideas on how to get google translate's text to the ResponseText (perhaps with HTTP request from this example ) To find the "did you mean: "bugless"" as shown with this link example:
  15. 2 suggestions * debug highlighted (right click to ClipPut) if i highlight this example will give -> SciTEWindow onto the clipboard WinAPI_GetClassName(WinGetHandle("")) * Add right click (Paste clipboard within Quotation Marks) in SciTE for instance "SciTEWindow" or 'SciTEWindow'
×
×
  • Create New...