Automation not working

Hey there. I have had some automation set up to automatically play when logging in. The AppleScript is this.

tell application "QuickTime Player"
set theMovie to open file "Users:user:Movies:Film1 Startup.mp4"
tell theMovie
set the presenting to true
set the looping to true
play
end tell
end tell

the script works just fine when I test it in Automator but when I actually log in to the system I get this error message

“the action “run AppleScript” encountered an error: Not authorized to send Apple events to QuickTime player”

Can anyone help me find a way around this? Also bonus points to anyone who knows how to make the QuickTime progress bar automatically hide when this script is ran.

Thank you.
You need to give your application permission in System Preferences > Security & Privacy > Privacy > Accessibility.
I have given my application access and I still get the same error. It says

”The action “Run AppleScript” encountered an error “Not Authorized to send Apple Events to QuickTime Player”
If this is in Mojave or later, does the application have the appropriate NSAppleEventsUsageDescription key(s) in the Info.plist?

I have added the NSAppleEventsUsageDecription key to have the string - App needs to control QuickTime player
I also have the string AppleScript needs to control QuickTime player.
update: I am using the latest MacOS Big Sur beta. Also I have added the key
Code Block <key>NSAppleEventsUsageDescription</key>
<string>Application needs to control QuickTime Player</string>

it is still giving the same error on startup

The action “Run AppleScript” encountered an error: “Not authorized to send Apple Events to QuickTime Player

I feel like I’m missing something basic but not sure.



Is your script signed? If so, does it have a stable code signing identity? This and NSAppleEventsUsageDecription are the two most common gotchas with packaging AppleScripts as applets.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Automation not working
 
 
Q