manit Posted Monday at 04:16 AM Posted Monday at 04:16 AM hi , I am using autoit for clicking in audacity application Here is relevant part of code #include <MsgBoxConstants.au3> #include <Date.au3> AutoItSetOption("SendKeyDelay",500) Local $TextFileName = "Log.txt" $Logging = "Hello at " & _NowDate() & ' ' & _NowTime() &@CRLF FileWrite($TextFileName, $Logging) Local $pythonplayvividh=Run(@ComSpec & " /c " & "python play-vb-in-browser.txt") Sleep(10000) Local $prev_audacity_handle = WinWait("Audacity","",10) If $prev_audacity_handle == 0 Then ; Do $Logging = "Opening audacity application" &@CRLF FileWrite($TextFileName, $Logging) Local $iPID = Run("c:\Program Files\Audacity\audacity.exe", "", @SW_SHOWMAXIMIZED) Local $audacity_handle = WinWait("Audacity","",100) ;MsgBox($MB_SYSTEMMODAL, "Script_Info", "window with title audacity is " & $audacity_handle) Until $audacity_handle <> 0 Else $Logging = "Audacity application was already open" &@CRLF FileWrite($TextFileName, $Logging) EndIf If WinExists("Automatic Crash Recovery") Then Local $audacity_crash_handle = WinWait("Automatic Crash Recovery","",10) WinActivate($audacity_crash_handle) ControlClick($audacity_crash_handle, "", "[CLASS:Button; INSTANCE:5]");skipping not discarding selected $Logging = "Audacity crash window found and discard selected" &@CRLF FileWrite($TextFileName, $Logging) ;Send("{TAB}") ;Send("{SPACE}") Else $Logging = "Audacity crash window not found" &@CRLF FileWrite($TextFileName, $Logging) EndIf Here is content of log.txt Quote Hello at 28-08-2025 16:54:52 Opening audacity application Audacity crash window not found Audacity window found Here is the autoit window info tool analysis Also attached the window which i want to detect Please suggest - what I am doing wrong ? Thanks.
ioa747 Posted Monday at 04:46 AM Posted Monday at 04:46 AM in log.txt it says 'Audacity window found' which means it passed the "Automatic Crash Recovery" checkpoint and hasn't crashed yet the question is what happens below there is a loop that checks again if Audacity Crash what happens after the 'Audacity window found' point? I know that I know nothing
Nine Posted Monday at 12:16 PM Posted Monday at 12:16 PM 7 hours ago, manit said: Please suggest - what I am doing wrong ? Either the window is not shown yet when you check for it (which make sense since you do not wait between starting the app and checking for "Automatic Crash Recovery") Or "Automatic Crash Recovery" contains special character (like hard space) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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