title: How can I check if the window of a process exists in applescript?
body: <p>I'm doing this:</p>
  
  <pre><code>tell application "System Events" to click button "Reply" of window 1 of process "Notification Center"
  </code></pre>
  
  <p>Which gets an exception if there's no window. So I tried this:</p>
  
  <pre><code>if exists (window 1 of process "Notification Center") then
      tell application "System Events" to click button "Reply" of window 1 of process "Notification Center"
  end if 
  </code></pre>
  
  <p>But it seems like applescript doesn't do <code>window 1 of process</code> in a condition. How can I accomplish that?</p>