我想玩一個電影全屏一次,然後關閉播放器可編程。 我嘗試過使用QTMovieView,命令行和AppleScript,發現Applescript是最簡單的方法。關閉通過Applescript QuickTime
但是,因爲我真的不知道Applescript,我不能讓電影播放後的QuickTime自動關閉。
一切工作正常,但「完成」無法識別的重複行。 以下是帶有此錯誤的腳本:
錯誤「QuickTime Player出現錯誤:無法將文檔1插入到類型說明符中。」編號-1700從文件1完成到說明者
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
最後,我改成了這個,這樣好嗎?
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
新問題:應用在視頻完成前掛起。
你不需要重新啓動你之前的退出程序。在退出之前,您也不需要關閉文檔1。試試我的編輯版本。 – adayzdone
我可以將延遲1從中間移動到結束重複嗎? –