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.


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.

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.

After reading your post, I realized my real problem was one of perception. I was trying to automate at the wrong point. I assumed that because I couldn’t find and replace in Calendar, then that functionality wouldn’t be available in any Shortcut. Your advice to look at the calendar event instead of intercepting the ICS file put me on the right track. I was able to code what I needed during a 15 minute work break.
The only issue I have now is that while it searches for all calendar events that need to be modified, it produces a drop down list of events and a only allows me to modify one. Do I need to make a loop of some kind to handle all instances?
Thanks for the help!

Yes, exactly: sounds like you need a “Repeat With Each” loop! :wink:

Thanks, all! With your help I was able to create the shortcut I needed, and get over that “first shortcut” hurdle. It doesn’t look so scary anymore. :smiley: