try
tell application "Finder"
set sel to selection as alias list
if sel ≠ {} then
set fSel to first item of sel
set theMovie to fSel as string
end if
end tell
tell application "System Events"
set theMovie to movie file theMovie
set theDuration to (duration of theMovie) / (time scale of theMovie)
end tell
on error errMsg number errNum
set {cr, sep} to {return, "------------------------------------------"}
set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: " & errNum & cr & sep
beep
display dialog e
end try