Get Upcoming Calendar Events with Shortcuts in Monterey

Trying to get a text summary in Shortcuts in Monterey similar to the "Events Summary" in Automator.

What I would like to do is pass this to Terminal and do my own parsing of the text.

I can accomplish this in Automator, so I'm trying this in Shortcuts as an exercise.


Here's my working Automator Workflow:



...which used the text from the .ics file passed to Run Shell Script where I do my own parsing.


Is Shortcuts able to pass the text info to its Run Shell Script?

As far as I can tell, Shortcuts can pull only 1 item from the Calendar Event (i.e., date or name, but not date and name) If I could get a line by line Summary from Shortcuts that I could pass to Terminal, that would work for me as well (i.e. 11/01/21 - Change Oil ; 11/02/21 - Clone Mac ; etc)


Posted on Oct 30, 2021 1:32 PM

Reply
7 replies

Nov 1, 2021 2:42 AM in response to Tony T1

Tony T1 wrote:

FWIW, 4 Actions in Automator and took 40 in Shortcuts 🙂

The extra work in Shortcuts is not inspirational… I found an AppleScript on MacScripter written in 2016 that collects all Calendar events, then prompts for a date range, and then opens a TextEdit document with a list of date-stamped events and their description. Takes all of 15 seconds from start to finish. Not fun to read the AppleScript though… 🙃

Nov 1, 2021 5:10 AM in response to VikingOSX

The need for Shortcuts nested if statements (due to lack of AND, OR, NOT), is very ugly and non-apple like.

Instead of:


if NOT var_AllDay AND var_Title is "Test" and count is greater than 0
  do something


Shortcuts requires:

count var_label
if var_AllDay
  do nothing
Otherwise
  if var_Title is "Test"
    if count is greater than 0
      do something
   do nothing
  do nothing

Nov 1, 2021 6:57 AM in response to VikingOSX

Geez indeed!

And with the course set to Depreciate Automator, and scripting languages (i.e. perl, ruby, python) — Not that Apple has updated these recently — the only supported scripting will be [s]Applescript[/s] Script Editor and Shortcuts.

Shortcuts is still new on macOS, so hopefully they will clean up the need for nested if statements (still can't believe that Apple has not included AND, OR, NOT in the scripting)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Get Upcoming Calendar Events with Shortcuts in Monterey

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.