QuickTime Mute всех файлов дроплет - PullRequest
0 голосов
/ 14 октября 2010

Хотите каплю яблочного сценария, которая открывает файлы в 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

Ответы [ 2 ]

0 голосов
/ 17 ноября 2010

Вот как я заставил его работать.

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 голосов
/ 14 октября 2010

Вы должны указать каждое открытое окно в 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

Но я считаю, что есть также предпочтение не запускать автоматическое воспроизведение фильмов при открытии.

...