title: Detecting fullscreen on Mac
body: <p>I am writing an IM client for Mac (in Python, but an Objective C / Cocoa solution here is fine). I want to detect whether or not the user is currently watching a movie or playing a game in the foreground, or doing anything else that takes up the entire screen. If so, I won't play a sound when a new IM comes in, but if not, I will play the sound.</p>
  
  <p>How can I detect this? Is there some way to get the foreground window with Applescript and look at its dimensions? Or is there some other API call?</p>