views:

19

answers:

1

Want an applescript droplet that opens files in QuickTime and mutes them all. The script only mutes the front most opened file.

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
A: 

You need to tell each window open in Quicktime in turn to perform the action. An action has to have a specific target in Applescript; they way you have it written now, you are tell the Quicktime application, not a window in Quicktime.

Untested:

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

But I believe there is also a preference to not have movies auto-play upon opening as well.

Philip Regan
I understand what you are saying just don't know how to target all the windows.
timg
Still only does the command for the foremost window.
timg
telling the process may not recognize a document pointed towards via the script. I wouldn't know of another way to do this, and sometimes I come across those odd things that just can't be done. It happens.
Philip Regan
that is what I was thinking. Thanks for trying.
timg