Applescript exits with error when run via launchd I have an applescript running beautifully in Script Editor as well as from an osascript command at the Terminal. The script talks to the Reminders.app in order to pass iCloud reminder entries to a few parsing scripts on my mac.

But when I try to launchd it, a few errors pop up in the system log:

Aug 11 16:43:07 machinename osascript[19678]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/FITS.osax"
Aug 11 16:43:07 machinename osascript[19678]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
Aug 11 16:43:07 machinename tccd[3421]: Unable to prompt for client without display name (osascript)
Aug 11 16:43:07 machinename Reminders[18838]: Error: Event Not Permitted for command Intrinsics.get
    Direct Parameter: &lt;NSPropertySpecifier: scriptingReminders of scriptingLists named "Today" of scriptingAccounts named "iCloud"&gt;
    Receivers: &lt;NSPropertySpecifier: scriptingReminders of scriptingLists named "Today" of scriptingAccounts named "iCloud"&gt;
    Arguments:     {
    }
Aug 11 16:43:07 machinename com.apple.xpc.launchd[1] (local.reminders.taskpaper.sync[19678]): Service exited with abnormal code: 1


The SIMBL Performance error I believe to be harmless -- this is a known issue.

I am assuming likewise for the FITS error.

But I need some help resolving the tccd and Reminders errors.... It sounds to me like I simply need to somehow provide extra permissions if the script is going to be run via launchd.

Here's the plist file, too, if it helps:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
            &lt;string&gt;local.reminders.taskpaper.sync&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
            &lt;array&gt;
                &lt;string&gt;osascript&lt;/string&gt;
                &lt;string&gt;/Users/eck/Library/Scripts/reminders_to_taskpaper.scpt&lt;/string&gt;
            &lt;/array&gt;
        &lt;key&gt;StartInterval&lt;/key&gt;
            &lt;integer&gt;600&lt;/integer&gt;
    &lt;/dict&gt;
&lt;/plist&gt;
As bjbk commented, the problem was that osascript did not have Assistive Access. While it is easy to add .app programs to this list (System Preferences > Security &amp; Privacy > Accessibility), OS X doesn't allow binaries to be added through the GUI. See Jacob Palmela's blog for how to add a program via the command line, or just copy and paste the following command, substituting in the path of the program to be added where indicated before executing: 

sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','PROGRAM-TO-BE-ADDED',1,1,1,NULL)"


sudo is necessary because the sqlite3 db file is owned by root.