Greetings,
I am trying to achieve the following (see description in code window below). If I remove the Do/Until loop, then the Window Title detection works fine and I get through to the message box. When I do use the Do/Until loop, as shown below, the code skips to the messagebox even though the VLC Player Window does not have the "Announcement" string in the title. Why does this occur?
AutoIt
#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: D Script Function: Mutes VLC Radio Announcements. 1. Wait for a Window with a Title containing "Announcement" string. 2. Upon window/string detection, activate the VLC Player Window and mute the sound via the VLC menus. 3. Wait until there is no Window present with title containing the "Announcement" string. 4. Activate the VLC Player Window and unmute the sound via the VLC menus. 5. Loop to the beginning. #ce ---------------------------------------------------------------------------- ; Script Start AutoItSetOption("WinTitleMatchMode",2) ; Partial title match While 1 WinWait("Announcement", "") WinActivate("Announcement", "") Send("!a" & "{DOWN 6}" & "{ENTER}") ; Press VLC mute via VLC menus MsgBox(0, "Test", "Mute Me!") Local $Mute=1 ; Mute enabled Do If Not WinExists("Announcement", "") Then $Mute=2 ; Mute disabled Else ContinueLoop EndIf Until $Mute=2 WEnd Exit
Thanks in advance!