The Fantastical Action Series

Utilizing the new callback abilities in Fantastical 1.1.1, I've created a series of actions that automate various tasks and workflows by chaining Fantastical to other apps, all done using Drafts as a central hub for inputting text and calling URLs.

The Big One: The URL Event Action

This is an advanced action. For the simpler actions, scroll down below.

The URL Event Action solves a problem which frequently annoys me when creating events in Fantastical or other calendar apps: no tappable URLs. That is, if I want to create an event which involves me visiting a web page, or especially one which involves calling a URL action, there was never a way to create an event using Fantastical or the stock calendar app that would allow me to, in one or two taps, go from following the notification to being redirected to the URL I wanted. (I can't speak for other calendar apps which I haven't tried, but Fantastical is my preferred app anyway, so I wanted this ability using only it). In Fantastical, if you create an event that includes a URL for a webpage, the app will add that URL to the event details, but you still have to open the event in order to tap the URL and follow the link. That only works, however, with regular Internet URLs, not the app URLs that I discuss so often on this site. There is no way for me to make Fantastical create a tappable link for something like "drafts://". It will refuse, even if we place the URL in the specified URL box.

However, another app which I have written about before can create tappable URLs, even iOS specific app URLs: Due. As exemplified in The Due Later Action Series, we can create a reminder in Due which, when dismissed, redirects us to a URL specified in the reminder title. Furthermore, Due supports natural language input. That is, it can understand and create due dates based on the way we might say them naturally, such as "Tuesday morning," or "in three days." Fantastical is renowned for its own incredible understanding of natural language. Since both can accept data in this format, we can send the same text to both Fantastical and Due in a natural language format, and have them create an event and a reminder, respectively, set to the same date and time. Combining this fact with the new callback abilities in Fantastical and the power of Drafts, we can create an action sequence that solves the problem I mentioned above.

This action will create an event in Fantastical at your own specified date and time with your own specified title, then create a reminder in due set for the same date and time which, when dismissed, will call a URL that you specify.

In Drafts, your draft should be set up in this format:

[Date/time of event in natural language format] [title for event in Fantastical]
[URL to be called at time of event]

When you call the URL Event Action for a draft written in this format, Drafts will redirect you to Fantastical where a new event box will be opened and filled with the data from the first line of your draft: the date and time and the title of the event. Fantastical will understand the terms and set the date and time accordingly, then title your event from what text remains. After you press the Add button to create the event, Fantastical will redirect you to Due. In Due, the title box will be filled with your date and time and title, as well as the URL you wrote on the second line of your draft. Double tap the title bar for the reminder and the date and time will be set to what you have specified, leaving the title and URL in the reminder box. Add the reminder, and you're done.

Now when the time of your scheduled event comes, you will get a notification from Due (depending on your settings you may also get one from Fantastical, but you can ignore that one if you do). Follow the notification and dismiss the reminder. Upon checking the box to dismiss it, Due will prompt you with the URL that you specified in your draft when creating the event. Accept and you will follow the URL, or if it is an action, then the action will be called.

The URL

For the URL that you call (I'll be focusing only on the case of calling iOS URL actions, not plain website URLs, as those are easy and were technically already possible.) you can actually make use of many of the URL actions which I have previously discussed and posted onto the site. For instance, you can set up the URL Event Action to call the Cross Post Action and post to Twitter and App.net, or even the Triple Cross Post Action, posting to Facebook as well. You could also call an email action if that is what needs to be sent, or maybe send a text message. The possibilities are endless. If you don't want to do anything fancy, you can easily just tell Due to launch a particular app at the time of the reminder, as long as it has a basic URL scheme.

Some inconveniences

The one inconvenience about this action is that the URL which you call must be set up by hand. The way Drafts works, you cannot create enough variables to supply the date and time and title for your event and reminder, the URL to call, and also the text to be used in the URL. You will have to type in text you wish to use into the URL directly, as the "text=" parameter (for a Drafts URL). Furthermore, the text has to be URL encoded. Simply putting the text within curly brackets will work for Drafts trying to read it, but a limitation in Due causes the URL it tries to run to be cut off as soon as a space is met, so all your spaces have to be "%20"s. In all honesty, however, this is really not a very difficult task, especially if you were to also utilize my URL Creation Workflow in building the Drafts URL you want to call, and the quick URL encoding features of Launch Center Pro 1.1, which can be done even quicker with my urlEncode action. A final note for those who are unsure, to manually input the text for Due to use, simply replace the familiar [[draft]] parameter which we usually use in our actions with the actual text that you want to be used.

Another slight annoyance is that the natural language parsing system in Due is not nearly as powerful as that of Fantastical, so you will have to keep your input simple enough that Due can understand. Fantastical, luckily, should be able to understand anything you type if Due can understand it as well. (I go more into detail on the limitations of the Due natural language parser within the Due Later Action Series.)

Uses

Some of you may see why this is useful right away, but if you don't, here's an example:

Lets say that there's a big event coming up and you want to make sure that you remember to Tweet or post about it on App.net or Facebook on the day of. Before this action, your workflow when learning of the event would look something like this: first you create an event in fantastical, typing in the date and time and the title for the event. Then you wait until the day of the event. When your calendar notification goes off and reminds you of it, you type up up your Tweet and tweet it. Then you copy and paste it and post it to App.net. Then again for Facebook. That's four different apps, plus typing up the post and copy and pasting multiple times (and we all know how great and modern the copy and paste experience is on iOS). Using The URL Event Action, all this can be done long before the event so that when you're busy preparing for it on the day of, you just quickly tap twice and the whole process is done for you.

Based on the format I mentioned above, if you were to automate your workflow and use the Cross Post Action, lets say for an event called Big Event on December 31, you would type up your draft like this:

December 31 Big Event
drafts://x-callback-url/create?text=This%20is%20going%20to%20be%20a%20really%20big%20event&action=crossPost

Running The URL Event Action on a draft formatted like that would create an event in Fantastical on December 31 titled "Big Event", then (after you confirm that event) create a reminder in Due for December 31 (after double tapping the title bar) titled "Big Event drafts://x-callback-url/create?text={{This is going to be a really big event}}&action=crosspost". Despite "Big Event" being in front of the action, Due will still understand, and on December 31, when you are reminded and check the box on the reminder, you will be taken to Drafts where a draft will be created with the text "This is going to be a really big event", and it will be cross posted automatically.

Direct Import Link

Simpler Actions

tweetEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and Tweet the event title and (optionally) more info about it.

Direct Import Link

adnEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and Post the event title and (optionally) more info about it to App.net.

Direct Import Link

facebookEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and Post the event title and (optionally) more info about it to Facebook.

Direct Import Link

messageEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and send the event title and (optionally) more info about it as a text to a contact.

Direct Import Link

emailEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and send the event title and (optionally) more info about it as an email to a contact.

Direct Import Link

crosspostEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and Post the event title and (optionally) more info about it to App.net and Twitter.

Direct Import Link

triplecrosspostEvent

This action will take text which you write in a draft, send it to Fantastical where an event is created based on it, then return to Drafts and Post the event title and (optionally) more info about it to App.net, Twitter and Facebook.

Direct Import Link

Pulling From the Web

Create a bookmarklet using this basic JavaScript to create a new Draft with the title populated with the web page title and the body populated with the URL. From there you can add the date and time you wish to set an event to and, depending on which action you are calling, more info about it, and then then perform any of the above actions on the text.
JavaScript:
javascript:window.location='drafts://x-callback-url/create?text='+encodeURIComponent(document.title+'\n')+encodeURIComponent(location.href)+'';

If you simply want to take the data and go directly to Fantastical to create an event with it, then call back to Chrome after you finish, Federico Viticci created a JavaScript script which will do this for you here.

Other People's Actions

If you're a Clear user, Eric Pramono from Geeks With Juniors posted an action which allows you to create a new event in Fantastical and then use the callback to add the event as a task in Clear.

The Drafts Action Directory also added a simple tweak to the stock Parse in Fantastical action in Drafts. This will add your draft as an event in Fantastical, then use a callback to return you to Drafts when finished. You can grab that here.