Generating URL Scheme for YouVersion's Bible App using Pythonista

I use YouVersion's Bible app on a daily basis. It's the first app I open every morning. I usually end my Bible reading session by picking out a verse that hits home for me. Then, I store it in Momento, and cross-share it to Facebook and Twitter via Path.

As I was reading through Ben Tsai's website, I stumbled upon his post about YouVersion's Bible app URL Scheme. I didn't know that the app has any URL Scheme beyond the one shown in Launch Center Pro: youversion:.

Ben wrote about several undocumented URL Schemes that the app supports:

  • youversion://bible?reference=PHP.4.5+PHP.4.7
  • youversion://bookmarks
  • youversion://reading_plans

I was really excited with the possibility of storing/sharing a verse with a URL Scheme that could redirect me back straight to the verse. But, before I got to work, I realised that the app uses OSIS Book Abbreviations that requires me to have a Map/Dictionary stored somewhere for runtime lookup.

YouVersion's Bible app supports the selection of multiple verses and multiple verse ranges.

Converting the References to URL Schemes

YouVersion's Bible app allows you to select one or more verses within a single chapter, and put them into the clipboard. Here's an example of what the clipboard looks like if you select a single verse:

Guard your heart above all else, for it determines the course of your life. (Proverbs 4:23 NLT)

The first thing that came to mind was grabbing the (Proverbs 4:23 NLT) part using regular expression. I was using Patterns on the Mac and TextTool on iOS to tinker with it. Craig Pearlman, TextTool's developer, even helped me with my inadequate regular expression skills. But, I decided to go with Pythonista because I would need to convert the OSIS code too.

Read More

Phraseology 2.0 for iPad

A few hours ago, Greg Pierce who is well-known for his work on Drafts, released a 2.0 update to its writing app: Phraseology for iPad. Before I jump into what the new features are, I'd like to highlight a few things that make Phraseology different from other writing apps for the iPad.

First, you need to take a peek at Brett Terpstra's awesome work of doing features comparison for most (if not all) of the text editors on iOS: iTextEditors. A few things to note here:

  • Phraseology is an iPad-only app
  • Phraseology does not support sync
  • Phraseology 1.x supports Markdown format, but it does not support syntax highlighting
  • Phraseology supports TextExpander
  • Phraseology has its own URL Schemes

And, if you mouse-over on Phraseology's left-most column, you will learn that it integrates with Terminology, lets you reorder paragraphs and sentences, and provides you with extensive document stats, such as Flesh Kincaid Reading Ease/Grade Level, Gunning Fog Score, SMOG Index, etc.

Phraseology's Inspect view helps you improve the readability of your writing.

Inspect and Arrange views

If you want to continually improve your writing skills, Phraseology is your perfect companion. It lets you become a ruthless editor for your own work. You will spend a lot of time switching to the Inspect view to see how well your writing is. It provides you with readability analysis, average words per sentence, average syllables per word, and the list of root words (lemmas) found.

Read More

Launch iOS Actions from the Mac using Alfred and Command-C

In my first post about Command-C last week, I haven't really explored into the possibilities of sending data from Mac to iOS. After spending a few days learning AppleScript the hard (and maybe, wrong) way, I'm finally ready to share a few Alfred workflows that you can use to send data and trigger actions on your iOS apps.

The basic idea is pretty straightforward. On iOS, we store our custom URL actions in Drafts or Launch Center Pro. We need to find a similar place where we can store our custom URL actions. My choice is to go with Alfred. You are welcome to create similar approaches with other launcher Mac apps, such as Launch Bar, Quicksilver, and Keyboard Maestro.

Alfred 2 Power Pack allows users to create their own custom workflows.

Alfred 2 and its Power Pack

To install and run the actions in this post, you need to download Alfred 2, and purchase its Power Pack. You need the Power Pack to create and install custom workflows.

I have created a bundle where you can download all of the custom workflows I outline in this post. If this is the first time you install a custom Alfred workflow, simply double tap on the file in Finder, and it will automatically be added onto your copy of Alfred.

From Alfred to Drafts

By now, I'm sure you know that Command-C can send text/images from Mac to iOS. The problem with this built-in feature is the clipboard data still floats around the iOS pasteboard. What if we could put the clipboard data, assuming it's in text format, straight into Drafts instead?

Read More

Using 1Writer and Launch Center Pro to Create the Missing Dropbox Sync Feature in Drafts

I love writing in Drafts on my iPhone, even for longer posts. Writing in Drafts is a part of my daily workflow. Sometimes I start writing a new post in it, but oftentimes I'd start a new post on iA Writer on the Mac and continue writing in Drafts on my iPhone.

Writing on the iPhone allows me to work almost anywhere and anytime. The problems with writing on the iPhone are the internet connection and battery limitations. Turning off 3G allows me to save the battery - which in turn allows me to write for a longer period. On the other hand, it disables me from getting a real-time Dropbox syncing that apps like iA Writer and Byword offer. Even when I turn on the internet connection, most apps would try to sync the entire folder before letting me load the single file that I want to edit.

That's why I loved it when Drafts 3.5 introduced Import from Dropbox feature. It allows me to pick a file that I want to edit, load it in Drafts, and continue writing - without having to sync the entire folder nor keeping the internet connection alive at all times. With the release of Launch Center Pro 2.0, I created an action that allows me to pick the file and load its contents to Drafts without even switching to the Dropbox app.

The other problem with writing in Drafts is the lack of Dropbox sync support. Drafts has the feature to create a new file and prepend/append to an existing file; but not to replace the content of a file in your Dropbox. After a short research, I found at least three apps that support Dropbox's replace file content feature in their URL Schemes: Byword, Textastic, and 1Writer.

I have tried using Byword's URL Scheme, but I can't seem to make it replace the old file. Instead, it creates a new file each time I trigger its /replace URL. I haven't tried Textastic's URL Scheme, so I don't know whether it's going to work or not. But, I have tried 1Writer's `/replace` URL and it worked as I expected it to be.

1Writer uses a shorter name, instead of the full path name, of mapped Dropbox folders.

1Writer's /replace URL

I ended up creating a 1Writer URL that allows me to replace the content of a file in a Dropbox folder with the content of the current [[draft]]. The action is relatively straightforward, with two minor things that you need to do. First, you need to define the Dropbox folders that you will be referring to in 1Writer. Once a folder mapped in 1Writer, it may have a name that you can refer to - which can be different from the full path of that folder. For example, 1Writer may use "Meeting Notes" instead of the full "Apps/Meeting Notes" path.

Read More