Quicktime properties

Hi there I’m making a script to read the files in a sequence of folders then play each using Quicktime.

My problem is that I want a syatem beep at the end of each file, and for each file to close when it’s done.

I see the property close when done but how do I set it? My script below gives an error “unknown object type”

How do I set this, or set up something similar to achieve my goal?

Cheers
H.


tell application "QuickTime Player"
				activate
				open this_file
				set close when done to true
				set movie_name to name of front movie
				display dialog "Movie name is " & movie_name
				set show movie info window to true
				-- set close when done to true
				play movie movie_name
				
				beep
				
			end tell


‘close when done’ is a movie property, so it needs to target the movie:

set this_file to choose file
tell application “Macintosh HD:Applications:QuickTime Player.app:”
launch
activate
open this_file
tell front movie
stop
rewind
set close when done to true
set movie_name to name
end tell
display dialog "Movie name is " & movie_name
set show movie info window to true
play front movie
end tell

Another way to do this is to use the ‘playing’ property. When it’s done playing, you close the movie, and go on to the next movie. You could use a repeat loop to monitor ‘playing’ or an idle handler.

gl,

thank you that sorted it. :slight_smile: