Automation failing when running Apple script

517 views Asked by At

Hello I am using this Apple script in Automator to auto launch and play in full screens video using quick time.

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

The Script runs just fine when I press play in automator however, when I try and start the automation application outside of automator I receive this Message.

"The action "Run AppleScript" encountered an error "Not authorized to send Apple Events to QuickTime Player"

My Automation workflow looks like this

Workflow screenshot

I have allowed access to Security privacy > Accessability to the following apps: Terminal, Consul, AEServer, Automator, Consul, and Quicktime player.

I have allowed access to Security Privacy>Full Disk Access to the same above listed programs.

I have allowed access to Security Privacy > Automation to the following: Automator>QuickTime Player and Terminal>Finder

I am at a loss any help please.

1

There are 1 answers

2
vadian On

The error has nothing to do with Accessibility and Full Disk Access

You have to add the key NSAppleEventsUsageDescription in Info.plist of the script application.

Open the application package in Finder with Right-click > Show Package Contents, then open the Info.plist file in Contents with a text editor and insert

<key>NSAppleEventsUsageDescription</key>
<string>Jarvis needs to control QuickTime Player</string>

The position of the key value pair is irrelevant but it must not follow directly a key line.