Play an iTunes video with mplayer

iTunes is a good music player, but its video playing features are a bit clumsy. This script allows you to play the video files with mplayer. Save it to ~/Library/iTunes/Scripts/, choose a video file in iTunes and then select this script from the scripts menu.

property apppath : path to application "MPlayer OSX"

tell application "iTunes"
	repeat with x in selection
		set thetrack to location of x
		set played count of x to (played count of x) + 1
		set played date of x to current date	
		with timeout of 10800 seconds
			tell me to do shell script quoted form of POSIX path of apppath & "Contents/Resources/External_Binaries/mplayer.app/Contents/MacOS/mplayer -fs " & quoted form of POSIX path of thetrack
		end timeout
	end repeat
end tell