Skip to content

Instantly share code, notes, and snippets.

@gms8994
Created December 14, 2012 14:55
Show Gist options
  • Save gms8994/4285989 to your computer and use it in GitHub Desktop.
Save gms8994/4285989 to your computer and use it in GitHub Desktop.
tell application "Calendar"
tell calendar "Calendar"
set theStartDate to ((current date) - 1 * days)
set time of theStartDate to 1 * hours
set theEndDate to (current date)
set time of theEndDate to 1 * hours
set theEventListString to ""
set theEventList to every event where start date > theStartDate and end date < theEndDate
repeat with theEvent in theEventList
set theSummary to summary of theEvent
set theEventStart to start date of theEvent
set theEventStart to time string of theEventStart
set theEventEnd to end date of theEvent
set theEventEnd to time string of theEventEnd
set theEventListString to theEventListString & "* **[#calendar]** " & theEventStart & " " & theEventEnd & " " & theSummary & "
"
end repeat
copy theEventListString to stdout
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment