Send Text to Drafts for iOS from Fargo, and "Act" on It as Well

I work at a desktop computer all day at an office. Because I don't have personal apps installed on it, I've found it more efficient to use Drafts to take snippets of text and do stuff with it: send a text message; save a note to Evernote; add a meeting or to-do item to Fantastical or Due, respectively.

Many months ago, I developed a PHP web app called Taskpusher that allows me to enter some text in a form and specify an Action to perform on it in Drafts. All of this info is encoded and sent to my iPhone via an iOS app called Pushover. I get a notification on my phone, swipe it, tap on the link in Pushover, and the text I entered on my desktop computer is "pushed" into another app via the Drafts Action.

An example: I can create a Messaging Action in Drafts called "Message Wife." I type the text I want to send into a form on the desktop, tell the app that the Action I want to perform is "Message Wife," and hit Send. After I tap on the link in my Pushover notification, the iPhone messaging app opens with the recipient and the text already pre-filled. All I have to do is hit Send.

Since scripting has been enabled in Fargo, I have been learning bits of javascript, and I finally figured out how to replicate the functionality of Taskpusher in Fargo, with the help of Gmail.

This script does the following:

  • I enter my "draft" into a headline in Fargo.

  • I choose Gmail to Pushover from the Scripts menu.

  • A dialog box pops up. I enter the exact wording of the Drafts Action I want performed on my text. If I just want the text imported into Drafts, I enter nothing. I then hit OK.

  • A gmail compose window opens in a new tab. The recipient is my Pushover email address, which is available on the website after I've purchased the app in the store and registered an account. The subject is "draft." The body is a specially-encoded string.

  • I hit Send (or Tab + Enter], get a notification on my iPhone, swipe it, tap on the link.

  • The Drafts Action is performed.

  • Caveat: Pushover limits messages to 512 characters, including the title. Because the draft needs to be encoded and then the string needs to be modified to be successfully transferred to the body of the email, a blank space in your draft is the equivalent of four characters. Hence, your draft cannot be very long. A dialog box will pop up if your encoded draft is too long to be successfully sent to Pushover.

Some things you can do with this script:

  • Create a headline: "Meet Matthew Saturday 2pm"

  • Enter this action in the dialog box: "Parse in Fantastical"

  • Create a headline: "9:30pm don't forget umbrella"

  • Enter this action: "Send to Due"

  • Create a headline: "IPA is a good beer."

  • Enter this action: "Save to Evernote"

  • Above come with Drafts "out of the box," but there are lots of actions you can import into Drafts here.

Add These Scripts to Your Menubar

See the Fargo Scripting blog for info on how to set up a Scripts menubar.

First, make sure to get your Pushover key (buy the app and register an account) and put it in the quotes where it says "YOUR_PUSHOVER_KEY_HERE"

I've also created a script to get the encoded character count of a headline. This does not include the character count of the Drafts Action, but you'll get an idea if your headline is already too long.

I understand all of this is very complicated, but I use this script (and the Taskpusher app) all the time. If there are any points of confusion, please leave a comment and I will fill out the blog post as necessary.

Last built: Tue, Mar 31, 2015 at 2:05 PM

By Jeffrey Kishner, Wednesday, July 31, 2013 at 11:10 AM.