Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/30/2022 in all areas

  1. If you're just wanting to see what the array contains as part of your development process while you're writing or debugging a script, have a look at the _ArrayDisplay UDF (user-defined function). For example: #include <Array.au3> Local $windowSize = WinGetPos("[ACTIVE]") _ArrayDisplay($windowSize, "Current Window Coordinates") By the way, WinWaitActive("[ACTIVE]") really doesn't do anything since you're asking AutoIt to wait for the currently active window to become active. So there's nothing to wait for. It's like saying 'wait until 1 equals 1.' It's always immediately true and therefore is meaningless. If you want it to actually wait for a specific window to become active, you need to specify what window by passing either the Title and Text of the window, the window handle, or else using the advanced method for identifying the window.
    1 point
  2. 1 point
  3. NoNameCode, I raised the same point some years ago and a then-Dev told me that it was a design decision to block events when using GUISetState and that only that function should be used when dealing with AutoIt-created GUIs. Furthermore, it was suggested then the use of WinSetState on AutoIt GUIs could lead to unwelcome results, although, in the typically laconic style of that then-Dev, no hard facts as to what exactly might occur were forthcoming. So I would go for "feature". M23
    1 point
  4. You can always wrap it in a loop with a Sleep call ;~ Local $iCount = 0 ; While we haven't found the next button While Not IsObj($oButton4) ; Search for it $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition5, $pButton4 ) ; Attempt to create the object $oButton4 = ObjCreateInterface( $pButton4, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) ; If we found it (it's an object) If IsObj( $oButton4 ) Then ConsoleWrite( "$oButton4 OK" & @CRLF) Else ; Wait a little before retrying so we don't kill the old computers Sleep(500) ; Optionally, count the number of times this happens... ;~ $iCount += 1 ; If it loops too many times, return an error ;~ If $iCount >= 10 Then Return SetError(1, 0, False) EndIf WEnd Edit: And this works for finding a lot of things... I made this into a function to wait for elements/windows/etc to appear, cause I got bored...
    1 point
×
×
  • Create New...