2014-11-21 111 views
0

我需要编写一个AppleScript,以便它将打开QuickTime Player,从特定文件播放影片,并将其设置为全屏循环。请帮忙,我是写AppleScripts的小菜鸟。AppleScript启动并循环播放视频?

这是我迄今为止,但它似乎并没有工作。 :(

tell application "QuickTime Player" 
    open file "Macintosh HDN:Users:lalayana:Downloads:TV Master Keynote.m4v" 
    set the looping of movie 1 to true 
    play movie 1 
end tell 
+0

是不是这张贴在oDesk那天? https://www.odesk.com/jobs/job_~01bcd6da67cdbc508f – adayzdone 2014-11-21 21:48:31

+0

这不是我... – And0o 2014-11-21 22:34:16

回答

1

做到这一点最简单的方法可能是通过分配返回open file给一个变量的值,然后告诉变量(即,告诉那部电影)做它需要做的。

tell application "QuickTime Player" 
    set theMovie to open file "Macintosh HDN:Users:lalayana:Downloads:TV Master Keynote.m4v" 
    tell theMovie 
     set the presenting to true 
     set the looping to true 
     play 
    end tell 

    --use this to see what properties can be modified 
    --get the properties of theMovie 
end tell 

您可以取消get the properties of theMovie,看看有什么属性都可以修改。

如果不为你工作,你还需要指定正是你的“它似乎没有什么意思工作“。也就是说,如果发生错误,会发生什么错误或发生,或发生什么不同于你所期望的。我已经验证了上述功能在我的电影上有效。

+0

这工作谢谢你! – And0o 2014-11-21 23:19:32

-1

这对我有效。我用它在我工作的博物馆播放视频艺术作品。有用。

tell application "QuickTime Player" 
    activate 
    open alias "Users:ebowen:Desktop:MOUND_1.32GB_h264.mov" 
    play the front document 
end tell 
tell application "System Events" to tell process "QuickTime Player" 
    set frontmost to true 
    tell menu bar item 5 of menu bar 1 
     click menu item "Enter Full Screen" of menu 1 
     click menu item "Loop" of menu 1 
    end tell 
end tell 
0

我刚刚有这个问题,上面的解决方案并没有为我的苹果电脑工作,所以我修改了脚本以使其工作。我想让脚本在启动时启动,通过转至系统首选项 - >用户 - >登录项目完成。

tell application "QuickTime Player" 
    set theMovie to open file "Users:danielmcclane:Downloads:startvideo.mov" 
    tell theMovie 
     set the looping of theMovie to true 
     set the present of theMovie to true 
     play 
    end tell 
end tell