I’m running macOS Sonoma nd I’m seeing an issue when running scripts from the terminal via osascript
. A script will run in Script Editor, but fail when I run it as a saved file (osascript test.scpt
) or concatenated to statements (osascript -e 'use framework "Foundation"' -e...
).
I wish I got a more helpful error, but all I’m seeing is Segmentation fault: 11
, which seems to be related to memory access.
Here’s a simple script to add a calendar event that fails via osascript
:
use framework "Foundation"
use script "CalendarLib EC" version "1.1.5"
use scripting additions
set theStore to fetch store
set theCal to fetch calendar "My Calendar" cal type cal cloud event store theStore
set theEvent to create event event store theStore destination calendar theCal event summary "New Event" starting date (current date) ending date (current date) with runs all day
store event event theEvent event store theStore