Inspired by Stéfan’s post explaining how to voice capture TODOs using Google Assistant on Android, I decided to find out how one would go about hooking up Siri dictation on iOS to Org mode.
It turns out that Siri Shortcuts is a pretty amazing tool that can be used for all kinds of automation on your iPhone or iPad.
Furthermore, because Org mode is text files all the way down, you can use Siri Shortcuts to append to any of the said files via Dropbox or iCloud.
I used this idea to implement three different examples, in order of growing complexity:
- Send iPhone clipboard contents into a new Org mode entry, also recording an Org mode timestamp.
- Send the current web page to Org mode, with the title as the heading and the URL in the body text.
- Voice dictate longer text into an Org mode entry, recording the location (street address) and time.
These are just three simple examples which I needed for my workflow, but the general principle of piping Siri Shortcuts into arbitrary Org files enables a world of possibilities!
Send iPhone clipboard contents in Org mode
I use this shortcut when I want to save something I find on the Twitter app for example. From the app, I can share the relevant tweet, and then select “copy link”.
At this point, I activate the shortcut by swiping down, to the right and then tapping its name in the shortcuts widget.
The shortcut machinery starts, and after a second or two I end up with the following entry at the end of the pre-configured org file, right on my desktop, courtesy of Dropbox:
To configure this, create a new shortcut, and hook it up like this:
The actions you see are:
Format Date, with the current date selected as input, and a custom format with the string “yyyy-MM-dd EEE HH:mm”, to give me the org-friendly timestamp.
Text, which I use to format the org mode entry. When you edit the text, you can select “magic variables”, and that’s where I found “Clipboard”.
Append to File, which is the action you can use to append to files on Dropbox and iCloud, and perhaps also your sync service of choice.
Send the current web page title and URL to Org mode
This is useful when browsing on the phone, and you want to store a link for later processing on the desktop.
Whilst browsing said page, I tap the share icon, and then select “Send URL to Org mode” (the name I assigned to the shortcut), and a second or two later, the following entry appears in the org file I preconfigured as my mobile inbox:
The shortcut looks as follows:
This one is only slightly more complicated, because it’s intended specifically for the Safari share sheet.
When you create the shortcut, tap the three dots to the right of shortcut name to get to the Details window. Once there, check “Show in Share Sheet”. Under “Share Sheet Types” ensure that only “Safari web pages” is checked.
The bottom three actions are the same as above.
At the start we have two instances of the “Get Details of Safari Web Page” action, one to get the title, and the other to get the URL.
Dictate time- and location-stamped notes to Org mode
This is the most fun shortcut of the three.
You get to talk to your phone, and then watch as the transcription of your speech appears magically in the org file that you have open in Emacs on the desktop!
Here’s an example:
(As an aside, this handy Siri dictation guide has a bunch of tips for making paragraphs, punctuation and the all-important “smiley face”.)
The shortcut you create should look like this:
The final “Append to Document” action is not shown, but it is identical to the two short examples above.
Note that I’m using the “Get Current Weather” and “Get Details of Weather Conditions” actions to get my current location, as this is much faster than the perhaps more accurate “Location” action which seems to wait for a GPS lock. See this thread on reddit for more details.
The “Get Details of Locations” gives me my current street name, which is more than enough to remind me where I was when dictating the note in question.
Being able to send discoveries from the phone to Org mode is an important part of my knowledge management workflow.
I have been using Signal’s super flexible “Note to Self” function for this, but the Siri Shortcuts approach gets the snippets right into Org mode more quickly.
The note dictation into Org mode path is new to me.
I was surprised by how well Siri managed my accent. I’m curious to see how much this comes in useful during the coming weeks. Whatever the case may be, it does make for a fun demo.