Gregor_S Posted June 7, 2023 Share Posted June 7, 2023 Good morning, would be great to hear your thoughts in terms of organizing a real-time logging for the script operating with some application that should be always in focus as getting keys idea is to show some stages/ notes/ errors in real time there are some commands in help pages, but they are not really match. 1) ConsoleWrite() the foreground app may be set smaller, and SciTE in a full screen mode with vertical console thus console text would be visible in real time 2) TrayTip() not really good idea as not able to flash many messages correctly 3) ToolTip() notifications may be placed in any pos of the screen, but require a Sleep() command and display tips one by one 4) TraySetToolTip() not really good as require the mouse pointer to display 5) MsgBox() may be used to flash messages, but take focus from main app Link to comment Share on other sites More sharing options...
Gregor_S Posted June 7, 2023 Author Share Posted June 7, 2023 please, correct me if I miss something and there are any other ways thank you! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 7, 2023 Moderators Share Posted June 7, 2023 Gregor_S, Take a look at my Notify UDF - the link is in my sig. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Dan_555 Posted June 7, 2023 Share Posted June 7, 2023 You can print debug info in a second gui window ... Here is an example of adding (limited by deleting the oldest entry) debug text to a listbox: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: Dan_555 Script Function: Displaying important debugging text in a listbox The maximum item numer in this listbox can be limited so that the old items get deleted, when a new entry comes in #ce ---------------------------------------------------------------------------- #include <GuiListBox.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> ; Script Start - Add your code below here Global $debugComboMaxLines = 8, $debug_on = 1 ;Debug_on: enables-disables the debugging window. $debugCombomaxlines: How many items shall be always present in the list box. If $debug_on = 1 Then Global $debug = GUICreate("DebugLog", 320, 170, Default, Default, BitOR($WS_THICKFRAME, $WS_MINIMIZEBOX)) Global $debug_label = GUICtrlCreateLabel("Debug Last Active = 00:00:00", 4, 4,312,17) Global $idDEBUGListBox = GUICtrlCreateList("", 2, 22, 300, 130) GUISetState(@SW_SHOW, $debug) EndIf Func DebugLogText($txt) If $debug_on = 1 Then _GUICtrlListBox_BeginUpdate($idDEBUGListBox) If _GUICtrlListBox_GetCount($idDEBUGListBox) >= $debugComboMaxLines Then _GUICtrlListBox_DeleteString($idDEBUGListBox, $debugComboMaxLines) _GUICtrlListBox_InsertString($idDEBUGListBox, @HOUR & ":" & @MIN & ":" & @SEC & " - " & $txt, 0) _GUICtrlListBox_EndUpdate($idDEBUGListBox) EndIf EndFunc ;==>DebugLogText ;example code Local $hTimeI = TimerInit() While GUIGetMsg() <> $GUI_EVENT_CLOSE If $debug_on = 1 Then GUICtrlSetData($debug_label, "Loop Last Active =" & @HOUR & ":" & @MIN & ":" & @SEC) ;Debugging only If TimerDiff($hTimeI) > 1000 Then DebugLogText("Action #" & Int(Random(0, 100)) & " occured") $hTimeI = TimerInit() EndIf WEnd robertocm 1 Some of my script sourcecode Link to comment Share on other sites More sharing options...
Earthshine Posted June 8, 2023 Share Posted June 8, 2023 I use Log4a. Au3 and just read the log file with LogExpert My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
argumentum Posted June 8, 2023 Share Posted June 8, 2023 in https://www.autoitscript.com/forum/topic/199177-fork-udf-ish/ there's an example of a message catcher of sorts. Try it out, see if it does it for you. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now