More calendar event automation

With the swicsfix script in place, the question becomes how best to use it. It’s written to be run from the command line, like this:

swicsfix MDW_to_BNA.ics

While that works perfectly well, and is how I ran it while writing and debugging, it isn’t the most efficient way to transform the .ics file because when I’m scheduling flights I don’t normally have a Terminal window open with the working directory set to my Downloads folder.

I can set up an Automator service to run swicsfix on the selected file(s). This allows me to right-click on a newly downloaded .ics file in the Finder and transform it via an item in the Services submenu.

SWA fix service

This is probably a little more efficient than the command line route, but it still forces me to open the Downloads folder and navigate a long menu.

To me, the best answer is Hazel, which can watch the Downloads folder, notice that there’s a new .ics file from Southwest, and take appropriate action. With the following rule, there’s no need for me to do anything except download the .ics files when I make my reservation and then confirm that I want the events added to my calendar.

Hazel rule for SWA flight events

This rule both runs swicsfix on the .ics file and then opens it for addition in my default calendar program (which happens to be Apple’s Calendar right now, but if I change back to BusyCal, this rule will change with me).

In theory, these same things could be done by defining a Folder Action in Automator. I didn’t have any luck when I tried creating a few Folder Actions years ago, so I stopped trying. I assume I could get them to work if I spent a little more time learning about them, but Hazel just seems easier.