Automate editing of calendar event title

Hi, I’m new to this forum. I searched for this topic, but came up empty.

My employer provides my work schedule through a webpage that allows importing of the events as .ics files. The event title comes through as “Schedule for Week of …” and I want to automate replacing that title with the name and location of my employer. Any suggestions for a place to start will be appreciated.

I am looking at a shareware app called CaliBrate, but that will require running the app every week. I’m here because I want to automate this job.

Thanks!

Sorry, I’m not quite following. Did you mean exporting the events as .ics files? From the rest of the context, that seemed like it would make more sense, but it’s possible that I’m not fully understanding.

It sounds like you download an .ics file which has the schedule and in the .ics file are the words “Schedule for the week of” and you want to replace those words with different words (name and location of employer).

If that is correct, then… yes, you should be able to automate this to a fairly good extent. You can easily edit .ics files as they are simply plain text.

However, since we are in the realm of iOS, I have to admit that I am not 100% sure how to do this on iOS. On a Mac, I would suggest Hazel and some shell scripting. Perhaps someone with more iOS automation will chime in.

1 Like

Thanks for the quick reply, Tjluoma. Yes, that is what I meant. :slight_smile:

Most of my calendar work is done in iOS, so I’ll have to keep looking for a way to access the .ics file contents in that format.

My other option would be to find an iOS mail client that provides a Find and Replace function.

I’ve put together a quick Shortcuts shortcut that should help you do what you after with a bit of modification to suit your specific requirements.

https://www.icloud.com/shortcuts/d45b8fa7f5154eb18b0a0780cb5b867c

Sharing an ICS file from Safari isn’t working for me on Shortcuts at the moment; the share sheet options appear but are non-functional. Maybe a reboot or updating to 14.5 will help, but I have also set it to allow manual entry, defaulting to the clipboard when run standalone, and copying the URL does work.

You can choose whether to get it to do partial or full matching on the event title (/summary), but I’m hoping this will give you the gist to get started, and like @Tjluoma noted, it is a plain text file format, so if you treat it like text, you can more or less do anything you like with the data. I do that with contacted version (vcard files) as Shortcuts doesn’t surface all of the details from the file format through the user interface.

Now, as it stands, you can’t modify the content at source, so the shortcut/approach above is modifying it in transition. But, you also have the option to transform it at destination, once it is in your calendar. You could have a shortcut you run periodically (manual or scheduled) that picks out any events that match your desired event title structure and modifies the event title. This would save you working with ICS files and allow you to only have to work with calendar events (and share sheet/clipboard copied URLs, etc.)

I haven’t included a shortcut for that as calendar event filtering, loops and editing should be all that is required and is relatively straight forward I think; but if you want to pursue this and need additional pointers, they can be provided :wink:

Ultimately, you can decide for yourself which approach matches best to your own comfort level and is optimised for your needs.

Hope that helps.