I often need to schedule events and travel time to/from those events (so that others don't book meetings when I'm traveling). Creating those "fenced" events is tedious and doesn't satisfy my need for an elegant solution.
I would like a Launch Center Pro action that:
- prompts me to enter an event/date/time combo
- prompts me to enter an amount of time (in minutes) for the "beginning fence"
- prompts me to enter an amount of time (in minutes) for the "ending fence"
- creates three events – one for the event itself and two for the fences – in Fantastical
- The main event should use the text entered in Launch Center Pro for the title.
- The fenced events should use "UNAVAILABLE" for the title.
- returns to Launch Center Pro
INPUT:
Event: Appointment 8/19 11am
Starting Fence: 30
Ending Fence: 45
EXPECTED RESULT:
Three events created:
- Appointment, 8/19/2014 from 11:00 AM to 12:00 PM
- UNAVAILABLE, 8/19/2014 from 10:30 AM to 11:00 AM
- UNAVAILABLE, 8/19/2014 from 11:00 AM to 11:45 AM
https://launchcenterpro.com/s5vdv1
Right now, this action simply creates a reminder in Fantastical to manually create the fenced events later on.
- Any URL scheme-compatible iOS app is fair game.
This doesn't sound too difficult with some help from Pythonista, but I don't own Fantastical so I can't say for sure. The big bummer is that it looks like the Fantastical URL Scheme supports x-callback-url, but doesn't support any way of passing info back.
The ideal (but apparently impossible) workflow would be:
event
event
tofantastical2://parse?sentence=[event]&x-success=[[pythonista://fenced_fantastical?action=run&argv=]]
...`The inferior, though workable way:
re.search
to pick your datetime from theevent
sentence.The part that sucks will just be having to manually type in your event datetime in a consistent format (e.g.
02/05/2015 15:30
-- stuff like "next Tuesday" obviously won't fly like they would if you just used Fantastical's date parser).One other possibility is to see if you can get
dateutil
installed in Pythonista (looks like others have done it without issue), and use its parser instead -- which is pretty good but not perfect.I envision an LCP URL like:
pythonista://fenced_fantastical?action=run&argv=[prompt:Event name?]&argv=[prompt-num:Event duration in minutes?]&argv=[prompt-num:Beginning fence in minutes?]&argv=[prompt-num:Ending fence in minutes?]
and
fenced_fantastical.py
to be something simple that accepts the argv, uses datetime / time delta, as described above.Got to run. Good luck.