Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sends the input text to Fantastical, converting TaskPaper @due(YYYY-MM-DD) tags to plain text for Fantastical to parse as a Reminder. Designed for use with Drafts and Pythonista.
# tp2fantastical
# by Derick Fay, 2014-04-06
# an adaptation of the Selection to Fantastical Editorial workflow
# ( )
# for use with Drafts and Pythonista (both required)
# works on iPhone and iPad
# I have also written an equivalent script for TaskPaper for the Mac
# available at
# installation:
# 1) copy this script into Pythonista and name it tp2fantastical
# 2) create a Drafts URL Action with the following URL:
# pythonista://tp2fantastical?action=run&argv=[[draft]]
import sys
import webbrowser
import urllib
i = sys.argv[1]
#i = "Test item @due(2014-05-14)"
if '@due(' in i:
i = theStart + " due " + theDate + theEnd"fantastical2://parse?sentence=" + urllib.quote(i))

2014-04-21: corrected Drafts action


added link to Mac version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment