jarrodwhaley.com

I make films. I'm also a nerd.

Posts Tagged ‘Pythonista’:

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. 

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.

Link-Blogging With Drafts And Pythonista

I write about the useful aspects of both Drafts and Pythonista quite often. The fact is, these two applications (with a little help from TextExpander, naturally) make writing on iOS almost as easy as writing on a Mac. I have found a few key ways to use them to automate tasks which used to be tedious on mobile devices; my life is a lot simpler as a result.

One example–and it’s something I often use multiple times per day–is a combination of a Safari bookmarklet, a Pythonista script, and Drafts. It was developed by iOS automation-nerd Federico Viticci, and originally shared in his oft-refenced Macstories post “Automating iOS: How Pythonista Changed My Workflow“. Its inputs are: 1) text selected by the user on a Web page, and 2) that page’s URL. It passes those inputs through Pythonista, and then it shoots them over to Drafts. The output of Federico’s workflow–i.e. the new object in Drafts–consists of the user’s selected text, followed by the URL preceded by “From: “. I love it as a means of quickly getting started with a “link-blog” style post, in which a source is cited, and then a block quote is given. However, I had one small problem with the Python script: the link was injected after the block quote, and none of the output was formatted as Markdown. It just didn’t fit the way I want to write. So I tweaked it.

more »

Schedule Quick Reminders on iOS in Seconds

I’ve recently started learning Python, and in the process I’ve become a huge fan of a Python coding environment for iOS called Pythonista. It allows one to actually run scripts on an iPhone or an iPad, and given the fact that it has a great URL scheme, some really cool things are possible.

I decided last night that I’d try to create a means with which to easily send myself reminders on my iOS devices, using a Pythonista script and Drafts. The script takes minimal textual input from Drafts in the form of a note on one line and an interval of time (in minutes) on the second line. I fire a Drafts action, and that’s it. At the appointed time, I’ll receive a native iOS notification containing my reminder.

I find it really handy: there’s no need to fumble with Reminders.app, set a date and time, etc. And it’s also far, far quicker than trying to set a timer in Clock.app.

If you have both Drafts and Pythonista on your device(s), give it a shot. The relevant code, the Drafts URL action, and more can be found in my post on the Pythonista user forums.


UPDATE, July 18, 2013 9:56 PM: Version 1.1 tweaks the script to add an audio notification upon successful creation of a new reminder.