Jump to content

Recommended Posts

Posted


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.

window-info.png

to-skip.png

Posted

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

Posted
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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...