title: AppleScript not looping all numbers when using repeat
body: <p>I am using this script to close all "Alerts" in my notification bar:</p>
  
  <pre><code>tell application "System Events"
      tell process "NotificationCenter"
          set numwins to (count windows)
          repeat with i from numwins to 1 by -1
              click button "Close" of window i
          end repeat
      end tell
  end tell
  </code></pre>
  
  <p>However this doesn't close them all, even when there are no "Alert without Close button".</p>
  
  <p><code>try catch</code> didn't help. What's wrong?</p>