title: Closing QuickTime by Applescript
body: <p>I am trying to play a movie fullscreen one time, then close the player programmably.
  I have tried using QTMovieView, command line and AppleScript and found the Applescript is the most simple way.</p>
  
  <p>BUT, as I really don't know Applescript, I can not make the QuickTime auto close after movie playing.</p>
  
  <p>Everything works fine but the "done" was unrecognized in the repeat line.
  Here is the script with this error:</p>
  
  <p>error "QuickTime Player got an error: Can't make done of document 1 into type specifier." number -1700 from done of document 1 to specifier</p>
  
  <pre><code>tell application "QuickTime Player"
    activate
    open "/Users/...real path of the movie.mov"
    present document 1
    play document 1
  
    repeat until (get done of document 1)
    end repeat
  
    delay 2
    close document 1
  end tell
  </code></pre>
  
  <p>Finally, I changed to this, is this ok?</p>
  
  <pre><code>tell application "QuickTime Player"
      quit
  end tell
  tell application "QuickTime Player"
      activate
      open "/Users/.../...mov"
      tell document 1
          present
          play
          repeat until playing is false
          end repeat
          delay 2
          close
      end tell
      quit
  end tell 
  </code></pre>
  
  <p>New problem: app hang before video finish.</p>