Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/14/2023 in all areas

  1. To display Unicode correctly in the Scite console, change the Scite console setting to Unicode (charset 65001) and check that the font you use contains enough of Unicode for your needs. DejaVu Sans Mono is perfect for that. Then use the double conversion as cited above. First conversion is from a UCS2 (subset of Unicode used by AutoIt) to binary UTF8, second conversion is from binary UTF8 to UTF8 characters.
    2 points
  2. Here's a thread that talked about the same issue as you are: The outcome was basically to have a script running that was admin, was not admin, and have each individually launch applications as you needed their specific permission level. There's also this topic linked, does this meet your needs? (Just kidding, unless someone has a copy, the site that the file/UDF was hosted on is no longer available). Another option could possibly be to use the Task Scheduler, though that seems like a pretty involved method, and RunAs would likely be simpler, but either likely require password. Edit: This may also be of interest, since it has a cmd option: https://superuser.com/questions/171917/force-a-program-to-run-without-administrator-privileges-or-uac
    1 point
  3. What works for me : In file C:\Users\**username**\AppData\Local\AutoIt v3\SciTE\SciTEUser.properties font.monospace=font:DejaVu Sans Mono,size:11 code.page=65001 output.code.page=65001 NewFileEncoding=UTF8 utf8.auto.check=4 You're using UTF8 as source encoding. Chr(128) outputs the ASCII character of the SciTE output console. By default it's the default user setting, aka locale ASCII codepage. Also built-in ConsoleWrite "ASCIIfies" everything before display. To fix that in an UTF8 source with above settings in force, and to be able to display a good share of Unicode BMP use this: CW("€") ; Mixed language strings $s = "Большая проблема 大问题 बड़ी समस्या مشكلة كبيرة Test Title 😭" & @LF $s &= "Our familly " & ChrW(0xD83D) & ChrW(0xDC68) & ChrW(0xD83C) & ChrW(0xDFFB) & ChrW(0x200D) & ChrW(0xD83D) & ChrW(0xDC69) & ChrW(0xD83C) & ChrW(0xDFFF) & ChrW(0x200D) & ChrW(0xD83D) & ChrW(0xDC66) & ChrW(0xD83C) & ChrW(0xDFFD) CW($s) Func CW($s = "") If @Compiled Then _CUI_ConsoleWrite($s) Else _ConsoleWrite($s) EndIf EndFunc ;==>CW Func _CUI_ConsoleWrite(ByRef $s) Local Static $hDll = DllOpen("kernel32.dll") Local Static $hCon = __CUI_ConsoleInit($hDll) DllCall($hDll, "bool", "WriteConsoleW", "handle", $hCon, "wstr", $s & @LF, "dword", StringLen($s) + 1, "dword*", 0, "ptr", 0) Return EndFunc ;==>_CUI_ConsoleWrite ; internal use only Func __CUI_ConsoleInit(ByRef $hDll) DllCall($hDll, "bool", "AllocConsole") ;~ The following 2 lines don't work for compiled scripts due to a MS bug ;~ see last post in thread https://developercommunity.visualstudio.com/t/setconsoleoutputcpcp-utf8-results-in-code-page-850/413190 ;~ where MS support acknowledges it's a (still unfixed) bug in Windows itself ;~ So you can only display current locale codepage using current console font in a console when your script is compiled ;~ When running your script from SciTE, the UTF8 setting of SciTE overrides this bug and Unicode can be displayed ;~ DllCall("Kernel32.dll", "bool", "SetConsoleCP", "uint", 65001) ;~ DllCall("Kernel32.dll", "bool", "SetConsoleOutputCP", "uint", 65001) Return DllCall($hDll, "handle", "GetStdHandle", "int", -11)[0] EndFunc ;==>__CUI_ConsoleInit ; Unicode-aware ConsoleWrite Func _ConsoleWrite(ByRef $s) ConsoleWrite(BinaryToString(StringToBinary($s & @LF, 4), 1)) EndFunc ;==>_ConsoleWrite The string $s is a sequence of joined emojis with FitzPatrick mods, rendered as one glyph by the Unicode renderer. Using CW() you don't have to add a @LF. This function displays verbatim Unicode in GUI or CUI scripts run from SciTE. OTOH compiled scripts can only display characters in the user console codepage due to a bug in Windows (see comments in code).
    1 point
  4. correct... this seems to be a regression from the last applied fix for something else. Should be fixed in the latest beta zip.
    1 point
  5. Sorry for the delay. Client never got back to me, but that is good news, means it's working! :) Thank you all, as always, very helpful.
    1 point
  6. I'm not sure I understand. The point was that you register one function and launch the second function in it with the first line.
    1 point
  7. This will only work when: You have the full SciTE4AutoIt3 installer installed with AutoIt3Wrapper You compile to an EXE ! not A3X as that is missing the PE header a program has which contains the ICO info.
    1 point
  8. Break(0) ; user can not break - Windows Exit required 😉
    1 point
  9. I added: #RequireAdmin And it's working. Thank you very very much.
    1 point
  10. Instead of 'Button1' for the ControlClick, try one of these: ControlClick($hWnd, '', 'Button', 'main', 1) ControlClick($hWnd, '', '[CLASS:Button; INSTANCE:1]', 'main', 1) ControlClick($hWnd, '', 1, 'main', 1) Alternatively, if it doesn't matter if you click Continue or Cancel you could try just using WinClose or WinKill, though I imagine Continue makes it skip over the current item and continue processing, so those may not be options for you.
    1 point
  11. Testing this out I also had the output saving as a 'T', the issue was I don't think that $FO_UTF8 is the right flag. This code allowed the character to save: #include <Constants.au3> Global $sSpecialChar = 'Θ' ; Θ Global $sPath = @ScriptDir & '\Save.ini' ConsoleWrite('SpecialChar: ' & $sSpecialChar & @CRLF) ConsoleWrite('Path: ' & $sPath & @CRLF) Global $hFile = FileOpen($sPath, BitOR($FO_UNICODE, $FO_CREATEPATH, $FO_OVERWRITE)) If $hFile = -1 Then ConsoleWrite('FileOpen error' & @CRLF) Exit EndIf FileClose($hFile) IniWrite($sPath, "Example", "Test1", $sSpecialChar) Something to note is that using ConsoleWrite to display the character did not display it correctly in SciTE, and you also need to make sure that when the file is saved that the character is saved correctly in the source file. And, depending on what you're using these characters for, keep in mind that there are some specific separator characters: https://www.compart.com/en/unicode/search?q=separat#characters So you could use the invisible separator which should never be typed.
    1 point
  12. As example how to get with controls #RequireAdmin #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator Example() Func Example() ;work case ;find the item "Add primary intranet search location" ;and set to "WWW.google.com" ShellExecute("C:\WINDOWS\SYSTEM32\MMC.EXE", "C:\WINDOWS\SYSTEM32\GPEDIT.MSC") ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinWaitActive("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") ControlTreeView($hGPO, "", $hTreeView_1, "Expand", "#0|#0|#2") ControlTreeView($hGPO, "", $hTreeView_1, "Select", "#0|#0|#2") ControlFocus($hGPO, "", $hTreeView_1) ControlSend($hGPO, "", $hTreeView_1, "a") ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(300) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) ;find the item "Add primary intranet search location" Local $FindTxt = "Add primary intranet search location" $FindItem = ControlListView($hGPO, "", $hListView, "FindItem", $FindTxt) ConsoleWrite("$FindItem=" & $FindItem & @CRLF) ;If not found then exit If $FindItem = -1 Then ConsoleWrite("not found the entry:" & $FindTxt & @CRLF) Exit EndIf ;select the found item ControlListView($hGPO, "", $hListView, "Select", $FindItem) ;and send enter to open ControlSend($hGPO, "", $hListView, "{Enter}") Sleep(300) Local $sWinTitle = WinGetTitle("[ACTIVE]") ConsoleWrite("$sWinTitle=" & $sWinTitle & @CRLF) ;If WinTitle not $FindTxt then exit If $sWinTitle <> $FindTxt Then ConsoleWrite($sWinTitle & " not match to " & $FindTxt & @CRLF) Exit EndIf ;Retrieves the 'Editor' window handle Local $hGPOedit = WinWaitActive($sWinTitle) ;Click at the Enabled ControlClick($hGPOedit, "", "WindowsForms10.BUTTON.app.0.297b065_r69_ad14") ;set the text in the edit ControlSetText($hGPOedit, "", "WindowsForms10.EDIT.app.0.297b065_r69_ad13", "WWW.google.com") ;Click ok ControlClick($hGPOedit, "", "WindowsForms10.BUTTON.app.0.297b065_r69_ad16") EndFunc ;==>Example
    1 point
  13. Ha ok... so you say that these 2 directories are the same in this case?: Could you do me a favor and generate the log $(SciteUserHome)\SciTE_LUA_Scripts_Debug.err and PM/Email a zipped version it to me? (As described a few posts back) ps: There shouldn't be any registry definitions when you run portable as those will always be used by AutoIt3 & utilities when existing.
    1 point
  14. If Not @Compiled Then ; this is simpler and will work fine with portable setups $sA3Dir = StringLeft(@AutoItExe, StringInStr(@AutoItExe, '\', 0, -1)-1) If $beta Then $sA3Dir &= "\Beta" $sA3Ver = StringReplace(FileGetVersion($sA3Dir & "\autoit3.exe"), ",", ".") Else $sA3Dir = RegRead("HKLM\SOFTWARE" & ((@OSArch = 'X64') ? "\Wow6432Node" : "") & "\AutoIt v3\AutoIt", ($beta ? "beta" : "") & "InstallDir") $sA3Ver = RegRead("HKLM\SOFTWARE" & ((@OSArch = 'X64') ? "\Wow6432Node" : "") & "\AutoIt v3\AutoIt", ($beta ? "beta" : "") & "Version") EndIf .. I think that the above is better. Food for thought. Edit: Fixed the "$beta" part I did not considered when posting.
    1 point
  15. mLipok

    _MSSQL.au3 help

    You should really start using ADO.au3 udf.
    1 point
  16. Reinhardt1julian, Search for "listview sort" in the Help file and _GUICtrlListView_SimpleSort would jump out as a candidate. M23
    1 point
×
×
  • Create New...