Two Map Photos Workflows on iOS

A few weeks ago I thought I’d be clever (too clever it turns out) and try to integrate Dr. Drang’s map-photos.py Pythonista Script with Workflow so I could map photo locations directly from Photos.app. I was hoping to use Workflow to create an action extension that could grab a photo, put it to the clipboard and then run map-photos.py to display the location of the photo on a map without having to launch the script through Launch Center Pro or, slower still, opening up Pythonista, navigating to the script, and then tapping run. Unfortunately that project turned out to be a miserable failure because clipboard.get_image() in Pythonista doesn’t allow you to get the metadata of the image on the clipboard. Out of sheer laziness I left the useless workflow on my phone, taunting me every time I opened the app.

With the advent of general stability in Workflow 1.11, I decided to spend some time thinking about how I could better use the app. Tonight, for some reason, inspiration struck when I saw the Map Photos workflow looking me in the eyes. So I decided to take on the challenge.

The initial workflow idea was to create an action extension that could select multiple photos and display them all as separate pins on the map. While I think this is possible, I didn’t want to get derailed with that. I just wanted a reliable way to serially display multiple images on a map on iOS. The easiest way I could figure out how to do this was by using an X-Callback-URL. The problem is that there isn’t a reliable way to return to the source app when using an X-Callback-URL from an action extension on iOS. Also, Apple Maps doesn’t support the callback function of the X-Callback spec, obviously.

So I looked online and it turns out that Google Maps on iOS does support the X-Callback-URL spec, making the choice a no-brainer. So I built two different workflows:

  • one that would be able to run as an action extension to map photos directly from Photos.app as well as other apps, and
  • one that could take a series of images, display them in Google Maps, then return to Workflow to load up the location of the next image and send that one to Google Maps.

The what I like better about the Dr.’s method is that it actually grabs the Latitude and Longitude from the image file, whereas my workflows grab the address. I typically prefer Lat/Long because, especially in rural or newly developed areas, using the address can be highly inaccurate. This is another reason why I’m using Google Maps on iOS for this project. Three years into Apple Maps I still trust Google’s data more.


  1. probably because now I know that the steps of my workflows won’t just randomly be erased when running the workflow 

BibleDraft 1.1

I’ve been hard at work (in the little spare time that I have) on some new projects and my use of BibleDraft has also continued to evolve. I want to thank Greg Pierce at Agile Tortiose for being so generous to tweet a link to the project on NYE 2014. I was amazed at the amount of traffic that came to my little blog (in 2 days I had more traffic than I had since I started blogging 18 months prior) for a little project about using Drafts for iOS as a Bible app. I had no idea people were so curious about it.

So, if you’re using BibleDraft, I have a little update for you. I just updated the script to v. 1.1. With BibleDraft 1.1, you can now:

  • Quickly send a Bible verse on iOS using the new “Text Bible Verse” action
  • Use a semicolon ; to separate multiple passages in addition to new lines of text
  • turned off links to the corresponding verse on ESV Bible Online. It’s actually off by default now. The “Preference” to turn them on is at Line 63 of the code.
  • if you do choose to have links on, the link ids are now much less hideously long

For more info on the entire project, check out the BibleDraft page in the projects section.

Also, if you’d like to use BibleDraft but don’t have Pythonista, would you let me know? Tweet to me and let me know if you have Editorial. I’m trying to see if I spend the time moving the entire project over to Editorial for greater appeal.

BibleDraft 1.0

Today I’m happy to finally put a project I’ve been working on for quite awhile on this site. The project is called BibleDraft and you can find its home on my new projects page.

BibleDraft1.0

The Background

Since the big thing in movies in the last 10 years has been origin stories, let’s start with the background[1] on this script. Continue reading

Workflow to Pythonista: New from Gist

While the rest of iOS-land is caught up in the Workflow frenzy, the past few days I’ve been spending my free time learning more about scripting in Python. One major project I’ve been working on is a large update to my Drafts & Pythonista workflow for getting Bible verses. Since I’m such a hack and Pythonista doesn’t have version control built-in, I’ve been uploading my work-in-progress files to GitHub as private gists so I can go back in case I royally screw things up. That’s caused me to be downloading a lot of gists lately. Continue reading