2014-11-21 108 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