2010-10-14 67 views
0

想要一個在QuickTime中打開文件並將它們全部靜音的applescript霧滴。該腳本只會將最前面打開的文件靜音。quicktime靜音所有文件霧滴

on open the_Droppings 
    tell application "QuickTime Player 7" to activate 
    tell application "QuickTime Player 7" to open the_Droppings 
    tell application "System Events" to tell process "QuickTime Player 7" 
     keystroke (ASCII character 31) using {command down, option down} 
    end tell 
end open 

回答

0

這是我得到它的工作方式。

on open the_Droppings 
    activate application "QuickTime Player 7" 
    repeat with oneDrop in the_Droppings 
     tell application "QuickTime Player 7" 
      open oneDrop 
      set sound volume of document 1 to 0 
     end tell 
    end repeat 
end open 
0

您需要在Quicktime中依次打開每個窗口以執行操作。一個行動必須在Applescript中有一個特定的目標;他們的方式你現在寫它,你告訴Quicktime應用程序,而不是Quicktime中的窗口。

未經測試:

on open the_Droppings 
    tell application "QuickTime Player 7" to activate 
    tell application "QuickTime Player 7" 
     open the_Droppings 
     set documentCount to (count documents) 
    end tell 
    repeat with thisDocument from 1 to documentCount 
     tell application "System Events" 
      tell process "QuickTime Player 7" 
       tell document thisDocument 
        keystroke (ASCII character 31) using {command down, option down} 
       end tell 
      end tell 
     end tell 
    end repeat 
end open 

但我相信也有偏好不會有電影在打開時自動播放,以及。

+0

我明白你在說什麼,只是不知道如何定位所有的窗口。 – tim 2010-10-14 18:08:34

+0

仍然只對最前面的窗口執行該命令。 – tim 2010-10-14 22:04:50

+0

告訴過程可能無法識別通過腳本​​指向的文檔。我不知道另一種方式來做到這一點,有時我會遇到那些無法完成的奇怪事情。它發生了。 – 2010-10-14 22:57:40