Fantastically Good Event Parser for Drafts 5
I used to have an action in Drafts 5 for adding calendar events using Fantastical, the favoured calendar app of many because of its ability to interpret events entered in natural language. Fantastical allows you to enter things like Meeting on Thursday at 5pm and then generates a calendar event by parsing out the information you provided. Compared to tapping on dialog boxes and scrolling date pickers in other calendar apps, it feels fast and easy.
The way the action works is to take each line of the draft and run it through the Fantastical URL scheme. Sometimes I would run this action with a lot of different events1 which meant watching as my iPad madly bounced back and forth from Drafts to Fantastical. If I remembered, I would put the two apps in split view beforehand to speed things up, but even with the
add=1 flag set in the URL scheme to avoid having to confirm each entry, Fantastical still shows an animation each time an event is entered, which slows things down.
What I’ve ended up creating has almost all of the same functionality as Fantastical, but since it does not rely on launching an external URL scheme, is considerably faster. You can enter multiple events, each on a different line, and have them all instantly added to your calendar without even launching another app. As with my Things Parser, I’ve leveraged the chrono.js library to do the natural language date parsing. My action supports the following things:
- Dates and times entered in natural language2
- Locations entered in the form
- Durations entered in the form
- Alerts entered in the form
alert 30 minutesor
alert 1 hour
- The specific calendar where the event should be created in the form
Unfortunately, my script doesn’t yet support creating recurring events as Fantastical does. This currently isn’t built in to the scripting capabilities of the
event object in Drafts, but I am hoping this might be added soon. When it is, I’ll be sure to update this action to support entering recurring events.
Each term, I used it to take a plain text version of my school timetable and add it to my calendar. ↩
Events given with a date but without a time are assumed to be all-day events. Events with a given start time but no end time are assumed to be one hour long. ↩
Note that the space is optional and that minutes and hours cannot be mixed. Minutes can be written as
m. Hours can be written as
Your calendars will be searched for the one beginning with the string you’ve entered. If you have two calendars with the same first letter, such as
timetable, try being slightly more specific by writing
/ti. If no calendar it specified, the event will be added to the default calendar. ↩