TL;DR How do you make a folder action that attaches folder actions to added subfolders? Is that even possible?

My end goal is to convert gps/location-based reminders of specific locations (e.g. home/work) into iBeacon-triggered reminders. I have an iBeacon reminders app, but I rarely use it mainly because it's buggy and it's not as convenient as asking Siri to remind me of things.

I have the iBeacon triggering of reminders for these locations worked out. But I want to be able to create the reminders using Siri, e.g. "Hey Siri, remind me to 'X' when I get to work", and have that set up the iBeacon-triggered reminder. Siri will already create a location based reminder in the reminders app and I know that related files are created in ~/Library/Calendars and I know how to tell which folder there-in contains the reminder events. I even know how to parse the ics files and translate which locations correspond to which iBeacons. I can do all that, but the hard part is reliably and in a timely and efficient fashion, catching the reminder-creation event so I can do the conversion to my iBeacon reminder system. All I have to do is, when a reminder is created, copy the reminder text into the place where the iBeacon event can grab it and issue the reminder.

I could poll the contents of ~/Library/Calendars every so often, but I have a lot of large calendar files with lots of events, so it would be better if I could do this via folder actions. Each event is a separate ics file. However, they're distributed among multiple .caldav/.calendar/ directories. And I'd like this strategy to be able to cope with the creation of new directories/calendars.

So I was thinking that I could create a folder action attached to ~/Library/Calendars that itself attaches folder actions which attach folder actions which parse .ics files to pull out the location, arrive/leave event type, and the summary to create the iBeacon reminders. But that seems kind of fragile and complex. Theoretically it seems like it could work, though I don't know what issues I might run into. I don't even know if a folder action can attach a folder action. Has anyone done anything remotely similar to this?

Or does anyone know of another way to have Siri create iBeacon reminders? (For those curious: I bought an app called Beecon which can trigger webhook calls based on iBeacon enter/exit events. My plan is to have it trigger IFTTT iOS notifications, among other things.)


You must log in to answer this question.

Browse other questions tagged .