Problems executing an osascript command via cron I have a little shell script which creates a new reminder for a project. This works pretty fine and I can execute in the command line newCfSamples "my new sample" and the reminder gets created.

I now have a little R script, which figures out what samples are new and it should create a reminder for this. This script works fine as well and creates the Reminders.

Both together, so cron is starting my R script fails at the point when it is executing my little newCfSamples script with the following error message: execution error: Reminders got an error: An error of type -1743 has occurred. (-1743).

I then started my script directly with cron and this also fails. Here is the complete error message.

Subject: Cron &lt;madejung@madejung-2&gt; /Users/madejung/bin/newCfSamples test
X-Cron-Env: &lt;SHELL=/bin/sh&gt;
X-Cron-Env: &lt;PATH=/usr/bin:/bin&gt;
X-Cron-Env: &lt;LOGNAME=madejung&gt;
X-Cron-Env: &lt;USER=madejung&gt;
X-Cron-Env: &lt;HOME=/Users/madejung&gt;
Date: Wed, 14 Sep 2016 15:42:00 +0200 (CEST)

290:540: execution error: Reminders got an error: An error of type -1743 has occurred. (-1743)


Would be great if somebody would help me get this running.

My newCfSamples script looks like this:

#!/usr/bin/env bash                                                                                                               
# Make a new reminder via terminal script                                                                                         
# args: remind &lt;title&gt; &lt;date&gt; &lt;time&gt;                                                                                                                                                                                 
my_date=`date "+%d/%m/%Y"`
my_time='09:00'
osascript - "$1" "${my_date}" "${my_time}" &lt;&lt;END                                                                                                        
on run argv                                                                                                                       
    set stringedAll to date (item 2 of argv &amp; " " &amp; item 3 of argv)                                                               
    tell application "Reminders"                                                                                                  
        make new reminder in list "CF User Sample" with properties {name:item 1 of argv, due date:stringedAll}                                             
    end tell                                                                                                                      
end run                                                                                                                           
END
I think I found the solution. As I mentioned in the above comments, I am using the GUI LaunchControl, I started the job once by hand with the menu Job -> Start and I got a little popup if R is allowed to access Reminders. I clicked yes and now it is working.

It looks like, this popup couldn't be displayed so I could never allow it.