Issue:
I have two calendars to which I subscribe from an external source which handles officiating schedules for myself and my son. Both calendars are nearly identical as we often share scheduled times for these events.
The calendar places the exact same 50char title for each event of which we can see 15-20 chars prior to being truncated, and not a single word in the title is helpful beyond knowing what they’re denoting.
Request for Help:
I would be happy with either option of editing the live events of the subscribed cal or duplicating all the events into a second cal and hiding the first. I assume editing the subscribed cal could cause some conflicts or some other grief, so if it’s easier or just plain smarter to grab the events from one cal and paste into another, I imagine that could be handled by pulling the plain text from the .ics and replacing the text in the .ics file for the duplicated cal but with some dynamic changes to the event titles if possible. I could then just hide the original cals and show the duplicated content cals.
Timing:
This does not have to be constantly live updated, and could be fired off nightly at midnight with a script or cron job, or even manually if I make a copy of the script into an app and just run it after I know that I should have new events added to the cals. I would likely tell the Calendar app to quit and delay a few seconds to settle any related .ics/.plist file updates, and then run the script. I think it would be smarter to run two separate scripts, one for each cal for each person, rather than trying to combine them into a single thread of actions.
If possible, when the scheduled script runs, I could set a variable (our initials for the title var) for each person just before running the embedded script so that the same script gets used, just twice, and with variables set in the parent script. I’m not sure this is even doable. I know I can run a script from within a script, just not sure if I can pass variables to the child script. The same variable could be used for both the title edits as well as the name of the ics file being edited or replaced. A bonus would be that the original destination .ics file gets backed up with a timestamp in the filename in an adjacent folder or some other placed automatically updated by TimeMachine and BackBlaze.
Ideal Event Edit Scenario:
The events have the [50char] “title” replaced with some event details like: "JB Ref “[varEVENTDATE(%I:%M)]” @ "[varLOCATION()]
~ where the varLOCATION could be matched and swapped against a list of variable replacements like:
- Company XYZ Full Name East Rink at Road Blvd becomes XYZ - East[/*]
- Company XYZ Full Name West Rink at Road Blvd becomes XYZ - West[/*]
- Company QRS Full Name Rink One Black becomes QRS - Black[/*]
- Company QRS Full Name Rink Two Red becomes QRS - Red[/*]
- Company QRS Full Name Rink Three Blue becomes QRS - Blue[/*]
- …List consists of 15-20 items against which the script would check and change text[/*]
Preferred Event Edit Scenario:
The events have the [50char] “title” replaced with some event details like: "JB Ref "[varEVENTDATE(%I:%M)]
Base Event Edit Scenario:
The events have the [50char] “title” replaced with some event details like: “JB Ref”
*Pardon my crude syntax as I know it’s not Applescript, just that I expect anyone here to recognize what I’m suggesting.