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: <NSPropertySpecifier: scriptingReminders of scriptingLists named "Today" of scriptingAccounts named "iCloud">
Receivers: <NSPropertySpecifier: scriptingReminders of scriptingLists named "Today" of scriptingAccounts named "iCloud">
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:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.reminders.taskpaper.sync</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/Users/eck/Library/Scripts/reminders_to_taskpaper.scpt</string>
</array>
<key>StartInterval</key>
<integer>600</integer>
</dict>
</plist>
osascript
and other shell scripts into the assistive access list, though this involves "hacking" its sqlite3 database (see here and here if your are interested). Towards that aim, I'm still working on connecting to the db file. A few possibilities for that...