使用applescript运行视频不起作用

时间:2018-09-23 10:16:58

标签: applescript

以下applescript旨在使用QuickTime播放器从文件路径打开视频文件,但我不确定为什么它不起作用,因为它带有模糊不清的威胁性错误,列为“未知”。请帮助修复它。谢谢。

tell application "QuickTime Player"
    set theMovie to open file ":Users:User:Desktop:Script:Video.mp4"
    tell theMovie
        set the presenting to true
        set the looping to true
        play
    end tell
end tell

1 个答案:

答案 0 :(得分:0)

HFS路径必须以卷名开头。

set theMovie to open file "Macintosh HD:Users:User:Desktop:Script:Video.mp4"

但是有相对的方法

set moviePath to (path to desktop as text) & "Script:Video.mp4"
tell application "QuickTime Player"
    set theMovie to open file moviePath
    ...