I'm looking to create a simple CLI tool to view today's events. Eventually I want to extend the scope but starting simple.
What I have currnently:
echo "set today to (current date)
tell application \"Calendar\"
tell calendar \"[email protected]\"
set curr to every event whose start date is greater than or equal to today
end tell
end tell" | osascript
and this gives output:
event id A2794321-6987-4DE0-BC70-DD75FFD5D770 of calendar id 87CF6FE8-B408-4931-8734-FDCBD95857C5, event id A62028B5-9F20-49F0-8660-94A55DC3E2BF of calendar id 87CF6FE8-B408-4931-8734-FDCBD95857C5
I am wondering if I could get some help on extending the shell script to output the events into a list with time and description etc!
Thanks :)
If you don't need to see recurring events:
set d to current date
set hours of d to 0
set minutes of d to 0
set seconds of d to 0
set out to ""
tell application "Calendar" to tell calendar "Calendar Name"
repeat with e in (events where start date > d - 1 and start date < d + 86400)
set out to out & time string of (get start date of e) & " " & ¬
time string of (get end date of e) & " " & ¬
summary of e & linefeed
end repeat
end tell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With