Search code examples
macosquicktimemultiple-monitors

QuickTime loses registration on second display


I just helped build a 24 hour movie for part of a video art installation. So this is an unusual situation. Here is the setup:

A Mac Mini with two displays. A QuickTime movie is playing full screen on display #2. The movie loops and is playing all day long. It never stops!

The 2nd display, occasionally loses its connection to the Mac Mini (we still don't know why). When this happens, QuickTime can't find display #2 and the movie slides over to display #1. When display #2 comes back online, the movie continues playing in display #1, overlapping partially into display #2. So it is no longer playing full screen. Instead we can see the corner of the movie in display #2.

I am looking for a script that would check if:

  1. Is the 2nd display online?
  2. Is QuickTime playing in full screen mode?

And if #1 is true and #2 is false, then tell QuickTime to enter full screen mode.

Is such a script possible? I am a complete fool when it comes to apple script, obviously, so I am open to any and all ideas.

We're using QuickTime 7 pro and the Mac Mini is running Lion.


Solution

  • Here are some code fragments. You should be able to build the script you need from these.

        tell application "Image Events"
            launch
            set countDisplays to count displays
            quit
        end tell
    
        tell application "QuickTime Player"
            --set the bounds of the first window to {-20, 0, 1280, 920}
            activate
            tell application "System Events" to keystroke "f" using {command down, control down}
        end tell