Jump to content

ioa747

Active Members
  • Posts

    1,684
  • Joined

  • Last visited

  • Days Won

    40

ioa747 last won the day on May 25

ioa747 had the most liked content!

5 Followers

Recent Profile Visitors

4,265 profile views

ioa747's Achievements

  1. _Msg($iUI, $sText, $sTitle = @ScriptName, $iTimeout = 3, $iOption = 0) Displays a message using different UI elements based on the specified $iUI parameter. ; https://www.autoitscript.com/forum/topic/212945-_msg/ #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <AutoItConstants.au3> ; #FUNCTION# ==================================================================================================================== ; Name...........: _Msg ; Description....: Displays a message using different UI elements based on the specified $iUI parameter. ; Syntax.........: _Msg($iUI, $sText, $sTitle = @ScriptName, $iTimeout = 3, $iOption = 0) ; Parameters.....: $iUI - Specifies the UI element to use: ; 0 - Return - nothing ; 1 - ConsoleWrite ; 2 - MsgBox ; 3 - ToolTip ; 4 - TrayTip ; $sText - The message text to be displayed. ; $sTitle - [optional] The title of the UI element. (Default is @ScriptName) ; $iTimeout - [optional] Timeout in seconds for displaying the message. (Default is 3) ; $iOption - [optional] Options for MsgBox, ToolTip, and TrayTip. (Default is 0) ; Return values .: Success: No specific return value, function exits after display. ; Failure: None ; Example .......: _Msg(1, "Hello, this is a test message.", @ScriptName, 5) ; =============================================================================================================================== Func _Msg($iUI, $sText, $sTitle = Default, $iTimeout = 3, $iOption = 0) If $sTitle = Default Then $sTitle = @ScriptName Switch $iUI Case 0 ; ### 0 Return - Does nothing, just exits the function. Return Case 1 ; ### 1 ConsoleWrite ConsoleWrite($sTitle & ": " & $sText & @CRLF) Case 2 ; ### 2 MsgBox MsgBox($iOption, $sTitle, $sText, $iTimeout) Case 3 ; ### 3 ToolTip ToolTip($sText, Default, Default, $sTitle, $iOption) Sleep($iTimeout * 1000) ; ToolTip doesn't have built-in timeout, so we use Sleep ToolTip("") ; Clear the tooltip after the timeout Case 4 ; ### 4 TrayTip TrayTip($sTitle, $sText, $iTimeout, $iOption) Sleep($iTimeout * 1000) ; give time to display it Case Else ; ### Else case - Does nothing, just exits the function. Return EndSwitch EndFunc ;==>_Msg ; Example Usage of _Msg Function ; ### ConsoleWrite ############################################### ; ConsoleWrite Example _Msg(1, "This message appears in the AutoIt console.", "Console Output") ; ConsoleWrite Example - Information-sign icon consisting of an 'i' in a circle _Msg(1, "This is an informational message.", "> Info") ; ConsoleWrite Example - Stop-sign icon _Msg(1, "This is a error message.", "! Error") ; ConsoleWrite Example - Question-mark icon _Msg(1, "This is a question message.", "+ Question") ; ConsoleWrite Example - Exclamation-point icon _Msg(1, "This is a warning message.", "- Warning") ; ### MsgBox ############################################### ; MsgBox Example - Information-sign icon consisting of an 'i' in a circle _Msg(2, "This is an informational message box.", "Info", 3, $MB_ICONINFORMATION) ; MsgBox Example - Stop-sign icon _Msg(2, "This is a error message box.", "Error", 3, $MB_ICONERROR) ; MsgBox Example - Question-mark icon _Msg(2, "This is a question message box.", "Question", 3, $MB_ICONQUESTION) ; MsgBox Example - Exclamation-point icon _Msg(2, "This is a warning message box.", "Warning", 3, $MB_ICONWARNING) ; ### ToolTip ############################################### ; ToolTip Example - no icon _Msg(3, "This is a question ToolTip.", "noicon", 3, $TIP_NOICON) ; ToolTip Example - Information-sign icon consisting of an 'i' in a circle _Msg(3, "This is an informational ToolTip.", "Info", 3, $TIP_INFOICON) ; ToolTip Example - error icon _Msg(3, "This is a error ToolTip.", "Error", 3, $TIP_ERRORICON) ; ToolTip Example - Warning icon _Msg(3, "This is a warning ToolTip.", "Warning", 3, $TIP_WARNINGICON) ; ### TrayTip ############################################### ; TrayTip Example - no icon _Msg(4, "This is a question TrayTip.", "noicon", 3, $TIP_ICONNONE) ; TrayTip Example - Information-sign icon consisting of an 'i' in a circle _Msg(4, "This is an informational TrayTip.", "Info", 3, $TIP_ICONASTERISK) ; TrayTip Example - error icon _Msg(4, "This is a error TrayTip.", "Error", 3, $TIP_ICONHAND) ; TrayTip Example - Warning icon _Msg(4, "This is a warning TrayTip.", "Warning", 3, $TIP_ICONEXCLAMATION) ; ################################################## ; Return Example (does nothing visible) _Msg(0, "This message will not be displayed.", "No Output") ; MsgBox Example $iTimeout = 0 _Msg(2, "All message examples have been executed.", "Examples Finished", 0)
  2. ; If you were to use a console, that would be fine. Global $GCSaves = '"' & @AppDataDir & '\Dolphin Emulator\GC\USA\Card A\"' Global $backupPath = '"' & @UserProfileDir & '\Documents\DolphinSaves\"' ; in Autoit (this case wants) Global $GCSaves = @AppDataDir & '\Dolphin Emulator\GC\USA\Card A\' Global $backupPath = @UserProfileDir & '\Documents\DolphinSaves\'
  3. _FileListToArray ( $sFilePath [, $sFilter = "*" [, $iFlag = $FLTA_FILESFOLDERS [, $bReturnPath = False]]] ) If $bReturnPath is set to True: The function will return the full path for each file and folder in the list. This means that the output will include the complete directory structure leading to each file or folder, making it easier to access them directly without needing to concatenate the folder path manually. like: ShellExecute($array[$i]) If $bReturnPath is set to False (default): The function will return only the names of the files and folders, relative to the specified $sFilePath. This means that the output will not include the full path, and you would need to prepend the $sFilePath to access the files or folders. like: ShellExecute(@ScriptDir & "\Startup\" & $array[$i])
  4. different approach #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WinAPIDlg.au3> _Main() Func _Main() Local $hGUI = GUICreate("Example", 250, 100) GUICtrlCreateLabel("Type name here (max 12 chars)", 20, 20) Local $idEditName = GUICtrlCreateEdit("", 20, 40, 160, 20, $ES_AUTOHSCROLL) GUICtrlSetLimit($idEditName, 12) Local $idEditResult = GUICtrlCreateEdit("", 20, 65, 160, 20, $ES_READONLY, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch ; Check if the active control is $idEditName If _WinAPI_GetDlgCtrlID(ControlGetHandle($hGUI, "", ControlGetFocus($hGUI))) = $idEditName Then Local $sValue = _InputLimiter($idEditName) If $sValue <> "" Then GUICtrlSetData($idEditResult, $sValue) EndIf WEnd EndFunc Func _InputLimiter($iCtrlInput, $iMaxBaseLength = 12, $sSuffix = "-PC") Local Static $sLastValue Local $sCurrentValue = GUICtrlRead($iCtrlInput) If $sCurrentValue <> $sLastValue Then $sLastValue = $sCurrentValue Return StringLeft($sCurrentValue, $iMaxBaseLength) & $sSuffix EndIf Return "" EndFunc Edit: variant with more advanced limiter Func _InputLimiter($iCtrlInput, $iMaxBaseLength = 12, $sSuffix = "-PC") Local Static $sLastValue Local $sCurrentValue = GUICtrlRead($iCtrlInput) Local $sFilteredValue = StringRegExpReplace($sCurrentValue, "[^a-zA-Z0-9]", "") If $sFilteredValue <> $sCurrentValue Then GUICtrlSetData($iCtrlInput, $sFilteredValue) Return "" EndIf If $sFilteredValue <> $sLastValue Then $sLastValue = $sFilteredValue ; Update static ConsoleWrite("$sCurrentValue=" & $sCurrentValue & @CRLF) ; For debugging Return StringLeft($sFilteredValue, $iMaxBaseLength) & $sSuffix EndIf Return "" EndFunc
  5. Thank you very much to @Davegbuf for all the useful information he provided us. my homework DPI_Scaling_Utility.au3 ; https://www.autoitscript.com/forum/topic/210543-setting-windows-display-scale-percentage-on-the-fly-without-reboot-or-logout/#findComment-1543707 ;---------------------------------------------------------------------------------------- ; Title...........: DPI_Scaling_Utility.au3 ; Description.....: Setting Windows Display Scale Percentage on the Fly without Reboot or Logout ; if $Command Line argument is provided, the script runs in command-line mode to set DPI. ; else If no arguments are provided, the script runs in GUI mode. ; e.g. Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\DPI_Scaling_Utility.au3" 100') ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 1.0 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y #include <WinAPISys.au3> #include <GUIConstantsEx.au3> #include <Array.au3> #include <FontConstants.au3> #include <StaticConstants.au3> ; Global array of common DPI scaling percentages supported by Windows. Global $DpiVals[12] = [100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500] ; Checks if a command-line argument is provided to determine operating mode. If $CmdLine[0] = 1 Then ; If one argument is provided, the script runs in command-line mode to set DPI. _CmdLineMode() Else ; If no arguments are provided, the script runs in GUI mode. Global $g_hGUI Global $g_idRecommendedDPILabel _GUImode() EndIf ;--------------------------------------------------------------------------------------- ; command-line mode to set DPI. Func _CmdLineMode() Local $bSuccess = _SetDpiScaleFromCommandLine($CmdLine[1]) ; Call the function to set DPI. If Not $bSuccess Then _ShowCommandLineSyntaxError() ; Show syntax help if setting failed. Exit(-1) ; Exit with an error code. EndIf Exit(0) ; Exit successfully. EndFunc ;--------------------------------------------------------------------------------------- ; GUI mode, DPI Scaling Utility Func _GuiMode() ; Create the main GUI window. $g_hGUI = GUICreate("DPI Scaling Utility", 220, 300) ; Label to display status messages and results Local $idMessageLabel = GUICtrlCreateLabel("Use the buttons below to get/set DPI settings.", 20, 20, 180, 40, $SS_CENTER) GUICtrlSetFont(-1, 10) ; Label to display the detected system-recommended DPI. $g_idRecommendedDPILabel = GUICtrlCreateLabel("Recommended DPI: Calculating...", 20, 65, 180, 20, $SS_CENTER) GUICtrlSetFont(-1, 9, 700) ; Set bold for emphasis. ; Button to display the current system display scaling percentage. Local $idShowDPIButton = GUICtrlCreateButton("Show Current Display Scaling (%)", 20, 100, 180, 30) ; Label for the DPI selection combo box. GUICtrlCreateLabel("Select Target DPI (%):", 20, 150, 180, 20) ; Combo box for selecting the target DPI percentage. Local $idDPIInput = GUICtrlCreateCombo("", 70, 170, 80, 25) For $i = 0 To UBound($DpiVals) - 1 GUICtrlSetData($idDPIInput, $DpiVals[$i]) Next ; It tries to set it to the current DPI if found in the list, otherwise defaults to 100%. Local $initialCurrentDPI = _GetCurrentDPIPercentage() If _GetDpiArrayIndex($initialCurrentDPI) <> -1 Then GUICtrlSetData($idDPIInput, $initialCurrentDPI) Else GUICtrlSetData($idDPIInput, "100") EndIf ; Button Try to Set DPI. Local $idSetDPIButton = GUICtrlCreateButton("Try to Set DPI", 20, 210, 180, 30) GUISetState(@SW_SHOW) ; Calculate and display the recommended DPI _UpdateRecommendedDPI() While True Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idShowDPIButton ; "Show Current Display Scaling" button. Local $currentDPIPercentage = _GetCurrentDPIPercentage() ; Get current system DPI. If $currentDPIPercentage > 0 Then GUICtrlSetData($idMessageLabel, "Current system scaling: " & $currentDPIPercentage & "%") Else GUICtrlSetData($idMessageLabel, "Error: Could not retrieve current DPI scaling.") EndIf _UpdateRecommendedDPI() ; update the recommended DPI label. Case $idSetDPIButton ; "Try to Set DPI" button. Local $dpiToSetString = GUICtrlRead($idDPIInput) Local $dpiToSetNumber = Number($dpiToSetString) If @error = 0 Then ; Attempt to set the DPI scaling using the shared logic function. Local $bSetSuccess = _SetDpiScaleLogic($dpiToSetNumber) If $bSetSuccess Then GUICtrlSetData($idMessageLabel, "Attempted to set DPI to " & $dpiToSetNumber & "%.") _UpdateRecommendedDPI() ; Update recommended DPI after a successful setting attempt. Else GUICtrlSetData($idMessageLabel, "Failed to set DPI to " & $dpiToSetNumber & "%. See console for details.") EndIf Else GUICtrlSetData($idMessageLabel, "Error: Failed to convert selected value to a number. Value read: '" & $dpiToSetString & "'") EndIf EndSwitch WEnd EndFunc ;--------------------------------------------------------------------------------------- ; Displays the syntax usage for the command-line mode in a MsgBox. Func _ShowCommandLineSyntaxError() MsgBox(16, 'Syntax Error', _ 'Syntax:' & @CRLF & @CRLF & _ 'YourScriptName.exe [percentage_value]' & @CRLF & @CRLF & _ ' [percentage_value]: The desired display scaling percentage.' & @CRLF & _ ' Examples: "100", "125", "150", "175", "200", etc.' & @CRLF & _ ' (You can optionally include the "%" sign, e.g., "125%")' & @CRLF & @CRLF & _ ' Special Value:' & @CRLF & _ ' "0": Sets the display scale to the system''s recommended DPI.' & @CRLF & @CRLF & _ 'Example 1 - Set scale to 125% : ' & @CRLF & _ ' YourScriptName.exe 125' & @CRLF & @CRLF & _ 'Example 2 - Set scale to 150% : ' & @CRLF & _ ' YourScriptName.exe 150%' & @CRLF & @CRLF & _ 'Example 3 - Set scale to Recommended DPI : ' & @CRLF & _ ' YourScriptName.exe 0', 60) EndFunc ;--------------------------------------------------------------------------------------- ; Function to set the DPI scale when called from the command line. Func _SetDpiScaleFromCommandLine($sTargetScale) Local $iTargetPercentage ; Clean the input string (remove '%' if present) $sTargetScale = StringReplace($sTargetScale, "%", "") ; Ensuring the input is an integer string. If Not StringIsInt($sTargetScale) Then ConsoleWrite("Error: Invalid input format for target scale: '" & $sTargetScale & "'. Expected an integer." & @CRLF) Return SetError(-1, 0, False) EndIf $iTargetPercentage = Number($sTargetScale) ; Convert the validated string to a number. ; If the target argument is 0, interpret it as a request for the system's recommended DPI. If $iTargetPercentage = 0 Then Local $iRecommendedPercentage = _GetSystemRecommendedDPIPercentage() If $iRecommendedPercentage = -1 Then ConsoleWrite("Error: Cannot determine recommended DPI." & @CRLF) Return SetError(-3, 0, False) ; Error if recommended DPI cannot be found. EndIf $iTargetPercentage = $iRecommendedPercentage ; Set the target percentage to the recommended value. EndIf ; Validate if the target percentage is one of the predefined DPI scales. If _GetDpiArrayIndex($iTargetPercentage) = -1 Then ConsoleWrite("Error: Target percentage " & $iTargetPercentage & "% is not a valid predefined DPI scale." & @CRLF) Return SetError(-2, 0, False) EndIf Return _SetDpiScaleLogic($iTargetPercentage) ; Call the shared core logic to set DPI. EndFunc ;--------------------------------------------------------------------------------------- ; --- Shared Core DPI Setting Logic --- ; function to calculates the correct relative index needed by the Windows API ; based on the system's detected "recommended" DPI and the desired target percentage. Func _SetDpiScaleLogic($percentScaleToSet) ; First, determine the system's recommended DPI percentage. Local $iRecommendedPercentage = _GetSystemRecommendedDPIPercentage() If $iRecommendedPercentage = -1 Then ConsoleWrite("Error: Cannot determine recommended DPI to set scaling relatively." & @CRLF) Return SetError(-6, 0, False) ; Error if recommended DPI cannot be found. EndIf ; Get the absolute array indices for the recommended and target DPIs from $DpiVals. Local $iRecommendedAbsIndex = _GetDpiArrayIndex($iRecommendedPercentage) Local $iTargetAbsIndex = _GetDpiArrayIndex($percentScaleToSet) ; Validate that both recommended and target DPIs are found in our predefined list. If $iRecommendedAbsIndex = -1 Then ConsoleWrite("Error: Recommended DPI (" & $iRecommendedPercentage & "%) not found in predefined list ($DpiVals)." & @CRLF) Return SetError(-7, 0, False) EndIf If $iTargetAbsIndex = -1 Then ConsoleWrite("Error: Target DPI (" & $percentScaleToSet & "%) not found in predefined list ($DpiVals)." & @CRLF) Return SetError(-8, 0, False) EndIf ; Calculate the relative index to pass to SystemParametersInfo. ; This is the crucial part based on the empirical observation that ; the API uses a relative step from the recommended DPI. Local $iFinalRelativeIndexToPass = $iTargetAbsIndex - $iRecommendedAbsIndex ; Log the parameters being used for the DPI setting attempt. ConsoleWrite("Attempting to set DPI:" & @CRLF & _ " Target Percentage: " & $percentScaleToSet & "%" & @CRLF & _ " Recommended Percentage: " & $iRecommendedPercentage & "%" & @CRLF & _ " Relative Index to Pass to API: " & $iFinalRelativeIndexToPass & @CRLF) ; Perform the actual Windows API call to set the display scaling. ; 0x009F corresponds to SPI_SETLOGICALDPIOVERRIDE (or SPI_SETLOGICALDPIAWARENESS). ; 0x0001 (SPIF_UPDATEINIFILE) ensures the setting is written to the user profile, making it persistent. Local $bSuccess = _WinAPI_SystemParametersInfo(0x009F, $iFinalRelativeIndexToPass, Null, 0x0001) ; Log API call failure if it occurs. If Not $bSuccess Then ConsoleWrite("API call _WinAPI_SystemParametersInfo(0x009F, " & $iFinalRelativeIndexToPass & ", ...) failed. @error=" & @error & ", @extended=" & @extended & @CRLF) EndIf Return SetError(@error, @extended, $bSuccess) ; Return success/failure status. EndFunc ;--------------------------------------------------------------------------------------- ; Function to find the array index of a given DPI percentage within the $DpiVals array. ; Returns -1 if the percentage is not found. Func _GetDpiArrayIndex($percentage) Return _ArraySearch($DpiVals, $percentage) EndFunc ;--------------------------------------------------------------------------------------- ; Function to get the current system-wide DPI in pixels per inch. ; (e.g., 96 for 100% scaling, 120 for 125% scaling). Func _GetCurrentSystemDPI() Local $hDC = _WinAPI_GetDC(0) ; Get device context for the entire screen (desktop). If $hDC = 0 Then ConsoleWrite("Error: _GetCurrentSystemDPI failed to get DC." & @CRLF) Return -1 ; Return -1 on error if DC cannot be obtained. EndIf ; LOGPIXELSX (88) retrieves the number of pixels per logical inch along the screen width. Local $iLogicalDPI = _WinAPI_GetDeviceCaps($hDC, $LOGPIXELSX) _WinAPI_ReleaseDC(0, $hDC) ; Release the device context to free up resources. Return $iLogicalDPI EndFunc ;--------------------------------------------------------------------------------------- ; Function to get the current display scaling percentage. ; Assumes that 96 DPI equals 100% scaling, which is the standard baseline for Windows. Func _GetCurrentDPIPercentage() Local $currentDPI = _GetCurrentSystemDPI() If $currentDPI = -1 Then Return -1 ; Error if DPI could not be retrieved by _GetCurrentSystemDPI. EndIf ; Calculate the percentage: (CurrentDPI / 96) * 100. Return Round(($currentDPI / 96) * 100) EndFunc ;--------------------------------------------------------------------------------------- ; Function to get the current relative DPI index (0 for recommended, 1 for next step up, etc.). ; This directly queries the value that corresponds to the second parameter of SPI_SETLOGICALDPIOVERRIDE. Func _GetRelativeCurrentDPIIndex() Local $relativeDPIIndex = 0 ; This variable will hold the relative index (0, 1, -1, etc.). ; SPI_GETLOGICALDPIAWARENESS (0x009F) when used to GET (uiParam=0), reads the current relative index into pvParam. Local $retval = _WinAPI_SystemParametersInfo(0x009F, 0, $relativeDPIIndex, 0) If $retval Then Return $relativeDPIIndex Else ConsoleWrite("Error: _GetRelativeCurrentDPIIndex failed to retrieve value. Return value: " & $retval & @CRLF) Return -9999 ; Sentinel value for error. EndIf EndFunc ;--------------------------------------------------------------------------------------- ; Function to determine the OS's recommended DPI percentage for the current display. ; This calculates the absolute percentage that corresponds to the relative index 0. Func _GetSystemRecommendedDPIPercentage() Local $currentActualPercentage = _GetCurrentDPIPercentage() If $currentActualPercentage = -1 Then Return -1 ; Return error if current percentage cannot be obtained. Local $currentRelativeIndex = _GetRelativeCurrentDPIIndex() If $currentRelativeIndex = -9999 Then Return -1 ; Return error if relative index cannot be obtained. Local $currentAbsIndexInArray = _GetDpiArrayIndex($currentActualPercentage) If $currentAbsIndexInArray = -1 Then ConsoleWrite("Warning: Current DPI percentage (" & $currentActualPercentage & "%) not found in DpiVals array. Cannot reliably determine recommended DPI." & @CRLF) ; If the current actual percentage isn't in our predefined list, we can't reliably calculate the recommended one. Return -1 EndIf ; The index of the recommended DPI in our array is the current absolute index ; minus the current relative index. Local $recommendedAbsIndexInArray = $currentAbsIndexInArray - $currentRelativeIndex ; Ensure the calculated index is within the valid bounds of the $DpiVals array. If $recommendedAbsIndexInArray < 0 Or $recommendedAbsIndexInArray >= UBound($DpiVals) Then ConsoleWrite("Error: Calculated recommended DPI index (" & $recommendedAbsIndexInArray & ") is out of bounds for DpiVals array. Cannot determine recommended DPI. This might mean the current DPI is not a standard step." & @CRLF) Return -1 EndIf Return $DpiVals[$recommendedAbsIndexInArray] ; Return the recommended DPI percentage. EndFunc ;--------------------------------------------------------------------------------------- ; function to update the recommended DPI label on the GUI. Func _UpdateRecommendedDPI() ; Only update GUI controls if the GUI window has been successfully created. If IsHWnd($g_hGUI) Then Local $recommendedDPI = _GetSystemRecommendedDPIPercentage() If $recommendedDPI > 0 Then GUICtrlSetData($g_idRecommendedDPILabel, "Recommended DPI: " & $recommendedDPI & "%") Else GUICtrlSetData($g_idRecommendedDPILabel, "Recommended DPI: N/A (Error or not in list)") EndIf EndIf EndFunc ;--------------------------------------------------------------------------------------- Added: if $CmdLine argument is provided, the script runs in command-line mode to set DPI. else If no $CmdLine arguments are provided, the script runs in GUI mode. ; e.g. Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\DPI_Scaling_Utility.au3" 100') If the $CmdLine argument is Special Value: "0" then sets the display scale to the system''s recommended DPI. Edit: Add more info with the power of SciTE AI Assistant
  6. I added a new function: _AI_Request which asynchronously sends a request to _AI_Call() and waits for the response. I also added a new parameter $iThink - Enable or disable thinking if Model supporting (0=none, 1=yes/not visible, 2=yes/visible). (Default is 0) to conform with the new ability to enable or disable thinking. (feature since version 0.9.0) Ollama now has the ability to enable or disable thinking. This gives users the flexibility to choose the model’s thinking behavior for different applications and use cases. When thinking is enabled, the output will separate the model’s thinking from the model’s output. When thinking is disabled, the model will not think and directly output the content. Models that support thinking: DeepSeek R1 Qwen 3 more will be added under thinking models.
  7. I did a normal install. What can I say, I don't remember if it was an upgrade. Besides, I have a bad habit of messing things up, so I might have done something wrong. At some point I made a portable version with SciTE v5x & lua Dynamic_include, but I didn't declare it correctly in the environment variables, and until I figured it out, it messed up some things. this means that I simply copy au3.keywords.properties to C:\Users\ioa747\AppData\Local\AutoIt v3\SciTE and is ok ?
  8. I found four in me "C:\Program Files (x86)\AutoIt3\SciTE\au3.keywords.properties" "C:\Program Files (x86)\AutoIt3\SciTE\Defs\beta\au3.keywords.properties" "C:\Program Files (x86)\AutoIt3\SciTE\Defs\Production\au3.keywords.properties" "C:\Program Files (x86)\AutoIt3\SciTE\Properties\au3.keywords.properties" I corrected the C:\Program Files (x86)\AutoIt3\SciTE\au3.keywords.properties and I threw it in the C:\Program Files (x86)\AutoIt3\SciTE\Properties\ and now it's ok. (at least until the next installation) Thank you very much
  9. and of course this approach assumes that the full title is visible in the explorer window Func ExitFolders() Local $sSrcPath1 = "E:\~About\Word\Examples\src\Images" Local $sSrcPath2 = "E:\~About\Word\Examples\src" Local $Info ; optional and temporary to see what happens ; ----------------------------------------------- If WinExists("[CLASS:CabinetWClass; TITLE:" & $sSrcPath1 & "]") Then $Info = WinClose("[CLASS:CabinetWClass; TITLE:" & $sSrcPath1 & "]") ConsoleWrite("SrcPath1 found, WinClose=" & $Info & @CRLF) EndIf ; ----------------- If WinExists("[CLASS:CabinetWClass; TITLE:" & $sSrcPath2 & "]") Then $Info = WinClose("[CLASS:CabinetWClass; TITLE:" & $sSrcPath2 & "]") ConsoleWrite("SrcPath2 found, WinClose=" & $Info & @CRLF) EndIf EndFunc ;==>ExitFolders
  10. The _ArrayFromString function is not correctly colored as a Standard UDF. Can someone tell me where I should look? Does it only happen to me? Thank you very much. Edit: Now that I looked in the C:\Program Files (x86)\AutoIt3\Include\Array.au3, the same applies to the _Array2DCreate
  11. ; https://www.autoitscript.com/forum/topic/212919-hotkeyset-and-hex-codes/#findComment-1543578 HotKeySet("{VOLUME_MUTE}", "MuteVolume") While 1 Sleep(100) WEnd Func MuteVolume() ConsoleWrite("This will mute the volume" & @CRLF) EndFunc look at Send() {VOLUME_MUTE} Mute the volume {VOLUME_DOWN} Reduce the volume {VOLUME_UP} Increase the volume {MEDIA_NEXT} Select next track in media player {MEDIA_PREV} Select previous track in media player {MEDIA_STOP} Stop media player {MEDIA_PLAY_PAUSE} Play/pause media player
  12. I divide the project into parts for easier management. AI_Assistant.au3 which is included in SciTE_AI_Assistant.au3, but can also be used as a standalone UDF in which I #include "StringSize.au3" ; "https://www.autoitscript.com/forum/topic/114034-stringsize-m23-bugfix-version-27-dec-23" by Melba23 - thanks for that So that it folds the console output, and is visible within its boundaries (especially when it is on the side and is slim) for more comfortable reading SciTE_AI_Assistant.au3 changed the approach (again) , and made it as SciTE tool. This way, the selection process, and console writing, is handled internally by SciTE. To do this you need to add the following to SciTEUser.properties (Adding_utilities_to_the_SciTE_Tools_menu) #------------------------------------------------------------------------------ # 41 SciTE_AI_Assistant command.41.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_AI_Assistant\SciTE_AI_Assistant.au3" command.subsystem.41.$(au3)=0 command.name.41.$(au3)=SciTE AI Assistant command.shortcut.41.*.au3=F10 command.save.before.41.$(au3)=2 # command.replace.selection.41.$(au3)=1 # command.quiet.41.$(au3)=0 # command.input.41.$(au3)=$(CurrentSelection) #------------------------------------------------------------------------------ #---------------------- Contex Menu ------------------------------------------- user.context.menu=\ ||\ >>>  SciTE AI Assistant  <<< |1141|\ ||\ Execute Selected Path|IDM_OPENSELECTED|\ #------------------------------------------------------------------------------ and make the necessary adjustments e.g. in command.41.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_AI_Assistant\SciTE_AI_Assistant.au3" your path for the d:\your\location\SciTE_AI_Assistant\SciTE_AI_Assistant.au3 You may need to adjust the 41 to the first tool number available to you. in this case, change the >>> SciTE AI Assistant <<< |1141|\ as well in the Context Menu I added: Prompt Builder GUI The script described is an advanced AI prompt builder tool The tool provides a user-friendly interface that allows users to create, manage, and execute AI prompts based on predefined templates or customizable settings from .ini file. macros in the Prompt Builder GUI @Selection@ = the Selection of SciTE @ScriptName@ = the Script Name (useful as title) @ScriptFullPath@ = all the content of Script @ClipGet@ = the content of Clipboard @FileRead(FilePath)@ = the content of FilePath FIM (Fill-in-the-Middle <??> ) when it comes to FIM (Fill-in-the-Middle <??> ), the '<??>' tag is to specify the-Middle e.g. as in the example below, highlight the text , right click , and select, >>> SciTE AI Assistant <<< , FIM (Fill-in-the-Middle <??> ) Func SumNumbers($aNumbers)     Local $iTotal = 0         For $i = 0 To UBound($aNumbers) - 1         <??>         Next     Return $iTotal EndFunc
  13. I don't know if I'm in the right place, I just discovered in the example C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_Timer_SetTimer.au3 which was an example for: _Timer_KillAllTimers _Timer_KillTimer _Timer_SetTimer that a line is missing from the example. $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetParts($g_hStatus, $aParts) ; * <-- this line is missing so that the example also shows the time, as it was designed
  14. I believe that if you put an _ArrayDisplay($array) you will understand why. #include <file.au3> #include <Array.au3> Local $array = _FileListToArray(@ScriptDir & "\Startup\", "0*.*", 1) _ArrayDisplay($array) For $i = 1 To $array[0] ShellExecute($array[$i]) Next
  15. As you can see, I can't test the script, so I'm just speculating At first glance, there are some irregularities here Local $label = GUICtrlCreateLabel($text, $x, $y + 3, $textSize, 22, 0, $gGroupDynamic) Local $btn = GUICtrlCreateButton($ticket, $x + $textSize, $y - 1, 60, 24, $gGroupDynamic) Local $btnCloseAll = GUICtrlCreateButton("X", $closeAllBtnX + 10, 5, 20, 20, $gGroupDynamic) you use as style or as exStyle to $gGroupDynamic = GUICtrlCreateGroup("", 0, 0, 685, 30) ; contenitore invisibile which doesn't seem right to me.
×
×
  • Create New...