Can’t get "play/pause" of window 1. Access not allowed. - trying to unpause movie through Applescript I'm trying to pause/unpause QuickTime Player with a little dictation command:

on run
    activate application "QuickTime Player"
    tell application "System Events"
        click "play/pause" of window 1
    end tell
end run


When I test this, I get the error message Can’t get "play/pause" of window 1. Access not allowed. Is there any way around this?

Thanks
I guess the answer to my question is to use the scripting dictionary for QTP instead of the using the UI. The website I got my code from is here and the code I'm using is below:

set movieFile to (path to me) &amp; name of front window of application "QuickTime Player"

tell application "QuickTime Player"
    try
        set isPlaying to get playing of document 1
    on error
        open movieFile
    end try
    if isPlaying is true then
    else
        set the looping of document 1 to true
        play document 1
    end if
end tell