Macos quicktime静音所有文件滴

Macos quicktime静音所有文件滴,macos,scripting,applescript,quicktime,Macos,Scripting,Applescript,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

想要一个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

您需要依次告诉每个窗口在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

但我相信也有一种偏好,那就是不要让电影在开映时自动播放。

以下是我让它工作的方式

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

我理解你的意思,只是不知道如何针对所有窗口。告诉进程可能无法识别通过脚本指向的文档。我不知道还有其他方法可以做到这一点,有时我会遇到一些奇怪的事情,就是做不到。我就是这么想的。谢谢你的努力。