Voice capture org-mode tasks on Android

EDIT 2023-01-07: This no longer works, since IFTTT deprecated the applet used. Please see Google Tasks to Org for an update.

I often want to capture tasks on the go—in a hurry. When there’s no time to fire up organice or Orgzly, being able to transcribe tasks comes in really handy.

In this post, I show how, on Android phones, you can hook up Google’s Assistant with org-mode, so that you can speak notes and have them appear as TODO items in a buffer.

Set up Google Assistant

First, we need to teach Google Assistant a new keyword, and tell it to store transcribed notes in an accessible location. We do this via the free If This Then That service. Add the “Log notes in a Google Drive spreadsheet” applet, and configure it as follows:

This would allow you to say task <description> and have Google Assistant log that to a spreadsheet in the Google Assistant folder of your drive.

Save the applet and try it out: launch Google Assistant and say “task test out capture system”. Then, locate and open the new spreadsheet in your Google drive. The URL should be of the form:

https://docs.google.com/spreadsheets/d/8B...ZFk/edit#gid=0

Note down that long string after /d/—this is your spreadsheet ID.

Set up org-mode conversion

Go to Tools -> Script Editor, and include the script provided at https://github.com/stefanv/org-assistant.

You have to customize two variables: the spreadsheet ID, and a random “token” (a password to make it harder for other to abuse the service).

Now, publish the script to the web: Publish -> Deploy as web app.... Set Who has access to the app to Anyone, even anonymous and note down the published URL.

Use it!

I have the following script that downloads TODOs and append them to an org-file:

#!/bin/bash

ASSISTANT_TO_ORG_URL="url-to-the-web-app"
ORG_INBOX="${HOME}/org/assistant-inbox.org"
TOKEN='token-value'

curl -s -S -L -d "$TOKEN" "$ASSISTANT_TO_ORG_URL?clear=1" >> $ORG_INBOX

I then have the following in my daily org checklist:

[[shell:~/scripts/assistant-tasks.sh][fetch tasks]] : [[file:~/org/assistant-inbox.org][tasks]]

The first link launches the script that fetches the latest tasks, and the second opens the tasks file.

Conclusion

Having a quick, hands-free way to capture tasks has been tremendously helpful to me. I hope you find it useful too!