This may be an obvious question - but I have trouble modifying a calendar event, by setting the ending time to an hour after start time. Appreciate any help please. Thanks:
use script "CalendarLib EC" version "1.1.3" -- put this at the top of your scripts
use scripting additions
use framework "Foundation"
use framework "AppKit"
set theStartDate to (current date)
set hours of theStartDate to 0
set minutes of theStartDate to 0
set seconds of theStartDate to 0
set theEndDate to theStartDate + (1 * days) - 1
set theStore to fetch store -- get the event store, which you need below
set theCalendars to fetch calendars "Calendar" event store theStore -- get the chosen calendars
set theEvents to fetch events starting date theStartDate ending date theEndDate searching cals theCalendars event store theStore -- get the events
set theEvents to filter events by pattern event list theEvents event summary "*" without using regex
repeat with nextEvent in theEvents
set theInfo to event info for event nextEvent
if (event_summary of theInfo) contains "MRN" then
set newEndDate to ((event_start_date of theInfo) + (60 * minutes))
set newEvent to modify event event nextEvent destination calendar theCalendars ending date newEndDate
store event event newEvent event store theStore
end if
end repeat