jarrodwhaley.com

I make films. I'm also a nerd.

Posts Tagged ‘iOS’:

QuickReminder 3.0

I’ve made a few more improvements. I added input prompts so that a reminder can be easily scheduled from within Pythonista, so Drafts input is now optional. I also commented the code much more fully.

As usual, you can get the script at this gist.

QuickReminder v. 2.1

My QuickReminder script for Pythonista is now at version 2.1. I improved the way that certain errors were handled, making everything a bit more friendly to the user. I’ve also made a small tweak which throws an alert when no time interval is specified, then relaunches Drafts, preserving the original reminder text.

You can always grab the newest version of the script from this gist.

A Flexible Random Number Generator on iOS

My girlfriend manages a retail store on the Web, which entails a lot of marketing via social media. She likes to run a weekly promotion on Facebook in which a prize is awarded to a randomly selected “liker”1. When she first conceived the idea, she didn’t really have a means of properly choosing a winner with any real amount of randomness2, so I thought I’d cook up a little Python script. I realized that something like this would be a handy little utility for my own purposes, and I also knew my girlfriend would be asking for random numbers with some degree of regularity. Those two conditions being the case, I decided I’d like to write something that could be easily fired from an iPhone or an iPad with minimal effort. The script below meets those requirements fairly well, I think.

more »

QuickReminder v. 2.0

I’ve updated my QuickReminder script for Pythonista to version 2.0, and it comes with a couple of cool improvements. Now, when the script begins to run, you’ll be prompted via a native iOS alert to either schedule the reminder or cancel it entirely1. The script will also return you to Drafts2 once your reminder is successfully set.

I have a lot of ideas for further improvements, so stay tuned. If you’d like to grab it, check out the gist.


  1. I’ve found on many occasions while running the script that I’d say, “oops,” and need to kill the notification so I could reschedule it, etc. 
  2. Required under my implementation, but it ought to be fairly simple to launch it with Launch Center Pro, for example. 

Easy URL Encoding on iOS

Occasionally it’s necessary to encode some text on iOS for easy insertion into a URL. It’s annoying enough trying to type out all of that word%20word%20word%20word gobbledegook, and it’s particularly painful trying to do so on an iPhone, since you have to dig down to the third keyboard in order to get to the % character. I came up with a couple of easy solutions to the problem using Drafts, TextTool, and Editorial.

  • The first method is a Drafts URL action which will send the text of the current draft to TextTool, properly encode the text for use in a URL, and then send the text back to a blank entry in Drafts:
    texttool://x-callback-url/transform?text=[[draft]]&method=encode&x-success={{drafts://x-callback-url/create?text=[[output]]}}
    
  • The second method is a workflow for Editorial which uses a Python script to replace the selected text with a URL-encoded version of the selection. Just install that workflow and fire at will.


UPDATE, 4:21 PM: Over on ADN, Jeff Mueller posted a handy permutation of my Drafts action for Launch Center Pro:

texttool://x-callback-url/transform?text=[clipboard]&method=encode&x-success={{launchpro:}}

Thanks, Jeff!

Wondering Why TextExpander Touch Needs To Access Your Reminders?

This has been a real head-scratcher for me over the past week as apps have been updating in advance of tomorrow's iOS 7 launch—why would TextExpander need permission to access my Reminders? Smile's blog explains that there's a very good reason:

When you update to iOS 7, you may find that TextExpander doesn't work in some apps which did work on iOS 6. Due to a change in iOS 7, those apps no longer have access to shared snippets. We have communicated with developers whose apps support TextExpander, and we've provided them an updated SDK with a new way to share snippet data.

In short, Apple has decided to break the way your snippets used to be shared between apps. Smile's solution is to store the data in your Reminders—because they're accessible even in the highly sandboxed environment of iOS. In a way, it's sad that developers have to figure out inelegant hacks like this one in order to provide basic functionality, but at the same time it does demonstrate the ingenuity of the developer community.

I wonder how many users will be refusing to give the app Reminders permissions and then writing support emails to Smile, complaining that the app doesn't work. What an (unavoidable) support nightmare.

Editorial Workflow: Cut the Current Line

I often find, while reading my notes, that I need to make a small change here or there—or else that I need to move a to-do item into an archive section, or to remove an entire item in an unordered list…basically, I often need to remove an entire line from whatever document I'm looking at. As often as not, it's nice to have that line in my system clipboard, because a lot of times I need to paste it in somewhere else.

This sort of thing is easy on a Mac, but it's often a huge pain in the something-or-other on a mobile device; you have to hold a touch until a selection loupe pops up, you have to slide both ends of it into the desired places, you have to copy, you have to scroll, you have to paste…it's really not very fun, and it often leaves me wishing I were sitting at my Mac.

Since Ole Zorn's very excellent iOS text editor Editorial was released, I've been trying to find ways to reduce this sort of friction on my iPad. One such trick is this little workflow I cooked up: it selects the entire line on which the cursor currently sits, “cuts” it to the clipboard (meaning it is removed and also placed on the clipboard), and moves the cursor to the end of the preceding line. It's triggered by a quickly-typed text snippet: xxx. Place the cursor at the end of the line, type the shortcut, and zing–line gone and copied. It's a simple little thing, but it gets rid of a really common task which is a huge pain to complete on iOS.

Here's a little companion workflow which does something similar: it selects the current line and copies it to the clipboard, but does not remove the line. Also pretty useful, this workflow is triggered with the command ccc.

Sending Markdown to Tumblr With Drafts

I noted a while back that the Tumblr app for iOS now supports x-callback-url, and I’ve played around with various URL actions in Drafts which make use of the implementation. I find in most cases, however, it’s easier to post text-based items using Tumblr’s publish-via-email feature—it sends the text directly to a blog, without requiring a ton of fiddling in the Tumblr app along the way. This being the case, I’m sticking with a Drafts email action which sends my text posts to a blog directly, with just one tap.

Tumblr’s email mechanism is actually very well thought out, and allows for everything from tagging to categorization to titling—and you won’t have to remember any annoying syntax if you write with Drafts; you’ll just enter your template into an email action and never think about it again. One quick, indispensable tip: if you write in Markdown (and why wouldn’t you?), simply add !m to the body section of your email action, and Tumblr will automatically convert your Markdown to HTML. Give it a try. As much as I like URL actions, sometimes you just want to fire off the text without tapping around in two different apps.

QuickReminder 1.1 – Quick iOS Reminders

Thanks in large part to a suggestion from Philip Mozolak on App.net, I’ve edited my QuickReminder script for Pythonista so that it plays a short audio notification upon the successful scheduling of a new reminder. It’s a minor tweak, but I think the additional feedback improves the experience of using the script quite a bit.

If you’ve been using the original script, all you need to do in order to update is copy the contents of the gist and paste them into your QuickReminder.py file in Pythonista.

Thanks, Moze.

Pythonista Developer Ole Zorn Announces Forthcoming iOS Automation App

Ole’s announcement:

I tweeted earlier today that I’ve registered the name for a new app in iTunes Connect. It’s called Editorial, and I’ve actually been working on this for over a year now.

At its core, it’s a Markdown editor for iPad, but you can also think of it as a Pythonista spinoff, or a workflow automation tool, not unlike Automator.

I will buy this the day it is released. The screenshots seem to promise an incredible number of possibilities.