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 
Advertisement

Using Drafts and Launch Center Pro/Workflow to Open Evernote Notes Directly

This past summer I stumbled across Jeffrey Kishner’s helpful post about using Pythonista, Drafts, and Launch Center Pro to create a direct link to any Evernote note on iOS. I have been using that workflow quite a bit to easily launch Evernote notes directly on my iPhone. Some of the notes I want to have quick access to are my Bible Verses to Remember and Prayer Requests notes.

There were a few things about the script that seemed like they could be optimized:

  1. There’s no need to get the link to the note from your Mac, you can get it directly from the iOS Evernote app.
  2. The manual of your six-digit string and the s.. in the Evernote URL could easily be automated.
  3. There workflow overall didn’t seem to be automated enough.

So I decided to try my hand at eliminating Pythonista from the workflow by using the new JavaScript actions in Drafts 4. To someone who knows JavaScript, or programming in general, I’m sure the script I hacked together is hideous, but it works, and to me that’s all that matters.

To check it out look for the Create Direct Link to Evernote Notes link on my projects page.

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

Using Drafts and Pythonista for Quick Bible Verses (ESV)

This workflow has been turned into the BibleDraft project. Visit that page for more info.

I have long had the desire to have quick access to the text of bible verses. Maybe I want to email it, text it, put it in Day One, or just have it for my immediate consumption. I've always felt that the Bible apps were too slow or had too many taps for that time when you just need to get the verse and move things forward.

So while on vacation this summer I took two of my favorite apps, Drafts and Pythonista and built a very simple Bible action. Drafts is perfect for this because when you open it up, it's ready to accept text. And I'd already modified a Python script for Editorial to take sermon notes with inline Bible verses. So I took those two tools and created a simple Drafts action to:

  1. Take the draft, needs to be a Bible verse (call me Captain Obvious)
  2. Send the reference to Pythonista
  3. run a Python script entitled “quick ESV verse” and have Pythonista pull the reference text from the ESV Bible's API
  4. Return the reference as bold markdown with the verses on the lines below it.

And that's all the action was designed to do. For the 3 people in the world who:

  • use Drafts
  • use Pythonista
  • use the ESV translation
  • are dissatisfied with the speed of looking up verses in their current Bible app

I hope you find this helpful. Grab the “Quick ESV” action for Drafts and create a script in Pythonista entitled “quick ESV verse.py” with the code below or if you have the “New from Gist” workflow installed in Pythonista you can get the link here.

Update 1: I realize that the way I tweaked the Drafts Action now requires Drafts 4. Some of you may still be running Drafts 3. If that’s the case let me know and I’ll update the script so it works on both versions

A quick tweak to my ESV Bible Workflow in Editorial

I’d previously written about how I went and turned Editorial for iOS into my favorite tool for taking sermon notes. Well, last night as I was falling asleep I came up with a slight tweak that really improves the workflow.

Previously, I had the workflow pop up an error if no text was selected. Last night I realized that popup would be better as input text box if no text was selected. So that’s the tweak I made and it really improves the workflow. That way you don’t have to type the verse and select it if you can anticipate that the pastor is going to reference another passage. You can download the updated workflow here.

A URL Scheme for Logos Bible Software for iOS

As a quick follow-up to my previous post, it turns out that Logos for iPhone/iPad does have a URL scheme. No, not the type I was looking for with X-Callback support, but still, a URL scheme nonetheless. I thought I’d quick publish how I’m using it in case any other geeks are looking for a way to open Logos directly to a bible or book.

We have chosen Psalms as a passage of scripture for our two girls. As a part of my nightly routine with my daughters, I will read the Psalm with them. I could be a normal dad and pull out a physical bible[1] or I could pull out my phone, which I invariably have with me everywhere I go. That means that if we’re somewhere and we just need to read something to keep her engaged, I have easy access to it.

I had been using the built in “favorites” feature to Logos for iOS but that was way too many steps. I was trying to think of ways to get to get to the Psalm. Should I put the text into a markdown file and launch that file from Launch Center Pro? Should I use LCP to launch directly to a website like Biblia.com that will have the passage? Neither of these options were great in my mind. Then after a few weeks, I remembered that Logos had URL links long before I got into this whole iOS automation thing.

I went to the Logos forums and realized that someone had already done a great job with LCP & Logos. So here’s what I did.

  1. Went to the passage I wanted in Logos for Mac and selected Copy Location as URL.
  2. Send Logos URL to my iPhone via Command-C
  3. Open Launch Center Pro
  4. Create a new action using the url on the clipboard as the URL.
  5. Name the action.
  6. Boom! Open directly to the passage (or section if it’s a book)

Getting a URL from Logos Bible Software for Mac

 


  1. I should note that my daughter and I do read out of The Big Picture Story Bible by David Helm almost every night.  ↩

Using Editorial on iOS to Build The Ultimate Sermon Notes Tool

One of the things I love about our new pastor at church is that he sends out an outline of his sermon on Fridays to all the small group leaders along with discussion questions. This is great because it’s allowed me to take much better notes on Sundays and to be focused on the content of what our pastor is saying, not just taking detailed notes.[1] My main workflow for doing this has been to take the email or PDF of the sermon outline, copy it into Drafts, take my notes there, and then send it to Evernote with a custom action that puts it in my “Jesus” notebook, tags it with “Sermon Notes”, and adds the date stamp to the note title in my preferred format.

A Few Issues with Drafts

Taking my sermon notes in Drafts has been fine, but I’ve found myself fairly limited by the way Drafts is setup to work. Drafts was designed for, well, drafts. Type a quick note, send it to Evernote. Type a quick text and send it out. You get the picture. Longer-form writing isn’t in the app’s purview, and that’s what sermon notes have become for me.

The main issue I was having was getting text from the Bible apps into Drafts. I wanted it done with a URL scheme, but there aren’t any Bible apps that I’ve been able to find using the X-Callback-URL scheme. So I was

  1. opening Drafts,
  2. then opening a Bible app,
  3. copying the text to the clipboard,
  4. switching back to Drafts,
  5. pasting the text as a new draft,
  6. sending the text to TextTool for cleanup using a Drafts action, and
  7. switching back to the sermon notes draft.

This workflow was eventually simplified somewhat by incorporating a Launch Center Pro action, but it was still way too cumbersome. So I was searching for a way to keep my mind more focused on the sermon than the technology for note-taking.

My Issues With The Bible Apps Available On iOS.

Before moving on to how I solved my problem, let’s just discuss the state of Bible apps on iOS. On my Macs I use Logos Bible Software for all my bible study needs. I have primarily used their great iOS app as well for my mobile study, daily devotions, and for reference during sermons. However, the Logos app has this odd formatting issue. If you copy text and paste it into another app, it includes all sorts of weird formatting, specifically related to footnotes.

In the screenshots below you can see the footnotes in Logos for iOS are in superscript. Well, when those get copied in plain text and pasted, they get converted to regular text, sometimes with zero-character spaces between them as shown in the second screenshot.

Logos for iOS
Logos for iOS
Text Pasted from Logos for iOS into Drafts
Text Pasted from Logos for iOS into Drafts

So I was looking around for other iOS Bible apps and came across the ESV Bible app for iOS. Ironically, it was my wife (not a techie), who I noticed using the app, so I gave it a try. When it was formatted into plain text, the results were much nicer (screenshots below), and thus I was able to clean them up in TextTool with a simple wrap function.

The ESV App for iOS
The ESV App for iOS
The Raw Paste from the ESV app
The Raw “Paste” from the ESV app
The Final Product of TextTools Wrap Function
The Final Product of TextTool’s Wrap Function

This was fine, but it was still way too cumbersome for quickly getting Bible verses into my sermon notes, especially when the pastor was on a roll. I needed a tool that could help me when the pastor just starts listing off verses that support his point.

How Editorial Helped Me With Sermon Notes

I’ll be honest, I loved Editorial when it came out for about a month. Then iOS 7 happened. The app looked dated quickly and since iOS 7 broke TextExpander support, I essentially stopped using the app. But with the recent 1.1 update, I started using Editorial again quite a bit. So much so, that I started using it for my weekly sermon notes. It came to mind one Sunday, that if I could find a Bible app that supported the X-Callback-URL I could have my ultimate powerhouse for sermon note taking. So I pinged a few random people that I knew were into tech and Jesus on Twitter.

I want to thank everyone who responded. Ben Whiting, Jordan Shirkman, Phillip Gruneich, and Eric Pramono, you guys were great. Eric has an interesting post on how he uses Launch Center Pro and Pythonista to share verses. But eventually I discovered that the app I was looking for didn’t exist. As I was thinking through the problem that Sunday, I remembered something. The ESV bible[2] had an online version and just maybe, they’d have an API for non-commercial use.

BINGO!

The ESV site even had some sample script in Python, which is great because I don’t know how to script or program, I’m just able to reverse-engineer code occasionally. So, I built two simple workflows to make Editorial harness the ESV Bible’s API, and help me stay focused on the sermons and not technology on Sundays.

The Workflows for Editorial

As I mentioned above, I don’t know how to code, I simple reverse engineered some workflows and the sample code from the ESV API. There’s a lot of work that could be done on these scripts, but for now, they do what I need them to do. If you’re handy with either Editorial or Python and want to give me some suggestions, I’m all ears.


  1. My brain doesn’t do well with doing two things at once. If I’m taking good notes, I’m not generally actively engaged in thinking about the content.  ↩
  2. my translation of choice  ↩

Making a SearchLink TextExpander Snippet (and Some Troubleshooting Too)

While I’ve been sitting around the house the past few days on paternity leave, I’ve gotten eager to fiddle with something. I decided it was time to create a TextExpander snippet that I’ve been meaning to make for a long time: turn the different search operators for Brett Terpstra’s SearchLink service into a snippet. Brett has built an amazing set of Mac OS X services for writing in Markdown. He also built SearchLink, which is a way to quickly make markdown links without having to go and navigate to a million different sites. I’ve always loved the service, but have found myself not using it very often because I have trouble remembering the search operators. So today, while my 21 month old daughter was down for a nap, I started my work.

Everything was going great. I entered all the different search operators I thought I’d use. I never plan to use App.net, define, or Last.fm operators so I left those out. After figuring out how to handle the "optional search text", I had my snippet working. It was time for a test run.

I tried to do a simple search:

[great iPad calendar app](!itu “fantastical for iPad”)

hoping to see a markdown link that would look something like this:

[great iPad calendar app](https://itunes.apple.com/us/app/fantastical-2-for-ipad-calendar/id830708155?mt=8&uo=4&at=11l8rP&ct=searchlink)

But, instead I kept getting this:

[great calendar app](http://lifehacker.com/5833969/the-best-calendar-app-for-iphone)

I went back through all of Brett’s instructions. At first I thought that I’d forgotten to install the Xcode Command Line Tools on my new Macbook Pro. So I logged into my developer account and downloaded the Command Line Tools (OS X Mavericks) for Xcode – March 2014 because the xcode-select --install command wasn’t working from the command line.

Next I tried to make sure that I had the JSON gem installed correctly, so I ran the old sudo gem install json. That kept returning errors for me, so I figured that I might be running into an problem with it parsing my search wrong and then doing a fallback to the Google results. I spent about an hour doing various searches through StackExchange trying to figure out how I could fix my Ruby troubles. Finally, I gave up on that.

Then I read that I should install the Command Line Tools (OS X Mavericks) for Xcode – Late October 2013 because of some sort of deprecated functionality in the 2014 tools. I tried that and while that appeared to help some of my Ruby errors (I could now get the JSON gem to install), it was still throwing off errors like:

unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.bundle, skipping

I figured those errors were what was causing the issue, so after about 2 hours of fiddling (including some permissions repairing, holding a newborn in one arm while trying to update Ruby, and another incident involving a serious poopy diaper from my 21 month old) I decided to just go and ask the developer, Brett, if he had any ideas.

Brett was gracious to do some troubleshooting with me. He told me that I shouldn’t be getting any results if the JSON gem wasn’t installed and that he was running stock Xcode Command Line Tools and the version of Ruby that came with OS X Mavericks. He ran the exact same search on his machine and got the correct results.

That got me thinking that I needed to go back to the basics. I started looking at making sure my search was EXACTLY the same as his. Then, somehow, it hit me: I’m using smart quotes. You know, those beautiful little quotes with the rounded edges.

Yes. Those. I lost almost 3 hours of my life to those dang things. They are gorgeous and they are a killer in Markdown.

Lesson learned: DO NOT USE SMART QUOTES IN MARKDOWN!

So with that figured out I was finally able to test my little TextExpander snippet properly. And it works beautifully. I’ve already used the snippet a fair amount in writing this post. I’m hoping that it will be a crutch until I can simply remember the search operators. Until then, happy expanding!

Download the SearchLink TextExpander Search Operator Snippet here.

A note to those on iOS: this snippet doesn’t work well with apps that sync to TextExpanderTouch on iOS like Drafts, Editorial for iPad[1], or Byword because it uses the pop-up menu. That feature is only available directly in the TEtouch app. Not to mention SearchLink* is a Ruby script and as far as I know, you can only run Python scripts on iOS.*


  1. Although Editorial developer Ole Moritz ported SearchLink to Editorial so as long as you can remember the search operators, you’re golden.  ↩