Parsing ics files


#1

I’m trying to extract meeting titles from fantastical to create meeting notes in draft, but I can’t get Shortcuts to do it. I thought maybe a script in drafts could parse the content of the ics file that fantastical sends through the share sheet.
Does anybody have pointers ?


#2

Do you have a sample file?


#3

In terms of pointers for Drafts, I think you could import and then run an action with some regular expressions to grab the text you want.

I’m terms of doing it in Shortcuts, I wrote a quick example that works for me with a handful of test cases.

Hope the above helps.


#4

Wow, that is convoluted, yet oddly easy to follow. Thanks! I’ll delve into it and report back.


#5

I have a Drafts action that runs a shortcut I found that lets you choose the format of your meeting notes and select the meeting from the current days events. I can’t remember where I got it from and I’m not sure how to share. I am pretty sure it will have been posted originally on this forum so you might be able to find it with a bit of searching.


#6

Not sure all the details, but you can also script reading directly from Calendars. This Import Calendar example might be a good starting point, and likely a cleaner way to approach the problem than manually sharing and cleaning up ICS files.


#7

The issue with that, if there is one, is that you have to apply the .ics file to the calendar first. I suspect there are use cases where it’s the raw ICS file that wants processing, without going anywhere near a calendar app.


#8

Thank you all for your pointers. The functional need was “get a list of today’s events; select one and prepare a draft ‘minutes of meeting’ template”.
I’ve ended up using the import events action suggested by @agiletortoise, mostly because it’s a good exercice in JavaScript , but the little shortcuts wizardry suggested by @sylumer is safely tucked away for later perusal.
As soon as I’m satisfied by my action, I’ll post it.
Thanks again!


#9

Here’s the action Make MoM .
Thanks for the help!