An interesting project by Paul Sidnell:

ofexport is a command line utility that reads and exports the task database from the OmniFocus application.

While similar to Robin Trew’s export utility, ofexport has a series of extra options worth trying out. I’m particularly intrigued by the control you can have on date and calendar filters, as well as regular expressions. I constantly check on my OmniFocus todos through the calendar, so I’ll make sure to test ofexport. [via Sven Fechner]

I use Evernote on a daily basis, but there’s no easy and quick way to create new notes and receive their shared URLs on iOS. While I tend to prefer plain text files, Evernote notes are quite useful when I need to share rich text (containing formatting and inline images) with someone else. Sharing via the official Evernote app takes too long[1], and I don’t like the UI of other Evernote clients.

Yesterday, Pythonista developer Ole Zorn posted an installer script for the Python Evernote SDK. By putting together all the necessary dependencies, he created an installer script that will create an “evernote-sdk” sub-folder in Pythonista 1.3; with that, you’ll be able to access the entire Evernote API to create and manage notes – all while taking advantage of the uniqe iOS-related features of Pythonista.

Inspired by Ole’s demoes and the snippets posted by Brett Kelly in the past weeks, I created a script that does exactly what I need: it lets me enter text to save it in an Evernote note that will be shared publicly. If triggered by an app like Drafts or Launch Center Pro, the script will take the text sent by those apps. If formatted in Markdown, the text will be converted to HTML before saving it to Evernote. (more…)

Ole Zorn’s Pythonista is one of my favorite, most-used iOS apps to date. Combining a Python interpreter with scripting capabilities that take advantage of iOS through native interface elements and features like URL schemes, Pythonista has completely reinvented my iOS workflow. With Pythonista, I can work from the iPad without wishing I had a Mac.

Back in November, I wrote an extensive review of Pythonista 1.2, providing some sample scripts and an in-depth look at the app and its functionalities. I concluded my review saying:

I believe that, going forward, Pythonista and other similar apps will show a new kind of “scripting” and task automation built around the core strenghts of iOS.

Pythonista 1.3, released today, adds a number of features aimed at making the app more “connected” with the underpinnings of iOS, enabling users to create more complex workflows that go beyond running scripts inside Pythonista. I was able to use Pythonista 1.3 for the past weeks, and I believe it’s a very solid update. (more…)

I’ve already expressed my preference for archiving webpages as PDFs rather than simple “bookmarks” on an online service. When I come across a webpage that I know I want to keep for future reference, I like to generate a clean-looking PDF file with selectable text that I can rely on for years to come.

Lately, I have become obsessed with turning longer articles I find on the Internet also into PDFs for long-term archival. For as much as I like Instapaper, I can’t be sure that the service will be around in the next decades, and I don’t want my archive of longform and quality content to be lost in the cloud. So I have come up with a way to combine Instapaper with the benefit of PDFs, Dropbox, and automation to generate documents off any link or webpage, from any device, within seconds.

Yesterday I put together an iOS and OS X workflow to generate PDFs remotely on my Mac, starting from a simple bookmarklet on iOS. On an iPhone or iPad, I can simply hit a button in Safari, and wait for Pythonista to turn a webpage (that’s already been passed through Instapaper’s text bookmarklet) into an .html file in my Dropbox, which is then converted to PDF and added to Evernote. It sounds complex, but in actual practice I can go from a Safari webpage on iOS to a PDF in the Evernote app in around 30 seconds. Hopefully you’ll find this quick solution useful; feel free to modify it and/or send suggestions. (more…)

Quickly Create Pythonista Shortcuts with Custom Icons

Interesting set of scripts posted on the Pythonista Community Forums (which, by the way, are becoming a daily appointment for me as Pythonista users are coming up with all sorts of tricks). Using Pythonista as a web server and Safari, you can create local (and unsigned) .mobileconfig files to automate the installation of Pythonista webclip icons. As I explained in my review, Pythonista can launch specific scripts using webclips created from a special webpage:

Upon tapping, a Pythonista Home screen bookmark will briefly open a blank page and then immediately redirect to the script you’ve configured in the Pythonista app. I’m fairly certain there’s no way to avoid showing a blank page for a second before redirecting to Pythonista; fortunately, it’s really just the fraction of a second, as the redirecting process is instantaneous both on my iPad 3 and iPhone 5.

Using the scripts linked in the forums, I easily managed to create a custom icon for my Markdown-Poster workflow that uses Poster‘s icon instead of the default Pythonista one. To extract and convert iOS icons for personal use, I recommend Crunch, which I’ve also previously reviewed. I was intrigued by how forum user pudquick figured out the installation of provisioning profiles from Pythonista:

When you run the code, it starts a web server in Pythonista – and copies the URL for the generated .mobileconfig file to the clipboard. When you switch to Safari and attempt to load the URL, the socket connects – but it’s waiting for communication from the web server in Pythonista (which is paused, since it’s in the background).

As soon as you switch back to Pythonista, this un-pauses the web server fast enough to cause Safari to finish loading the .mobileconfig file while it’s swapping to the background, which then triggers the installation screen!

Combining the script with this other one to easily generate base64 images, I suggest replacing Image.BILINEAR on line 20 with Image.ANTIALIAS for slower but better results in the overall crispness of the icon (I also changed the size to 114×114 for my Retina iPad).

Looking forward to improvements for Pythonista shortcuts (as mentioned by developer Ole Zorn in the thread), this is a nice stopgap solution to use scripts with custom shortcut icons in the Home screen.

Quickly Email A Picture On iOS Using Pythonista

In my review of Pythonista yesterday, I didn’t include any scripts to send email messages. Email is, however, a huge part of my iOS workflow, as I often send screenshots back and forth with my teammates about upcoming site features or new apps I’m testing. Fortunately, Pythonista developer Ole Zorn shared today a script that uses smtplib to quickly send an image via email. His script is available on GitHub Gists here.

I have modified it slightly to import my login data using keychain and send an image that’s been previously copied to the clipboard. In this way, I can take a screenshot/photo, open the Photos app, copy it, and send it via email in seconds, at full-size. You can save the script as shortcut on your Home screen and have one-tap access to it, or, even better, you can copy images from Safari without saving them first to the Camera Roll (though, in my tests, this hasn’t always worked reliably). My modification also uses console.input_alert to let you enter a different email address and Subject every time, and it plays a sound effect when an email is sent. Right now, the ImageMail script works with Gmail, but it could be easily modified to work for other email services.

In a future version of Pythonista, I think it’d be neat to have a dedicated Address Book module to return contact fields such as email addresses or Twitter usernames; Ole suggests Reminders and Calendar integration might be handy as well. I think Pythonista has a very bright future, so we’ll see. In the meantime, you can download my modified version of the ImageMail script here.

Pythonista is available at $4.99 on the App Store.

A couple of months ago, I decided to start learning Python.

I say “start” because, as a hobby to fit in between my personal schedule and work for the site, learning the language is still very much a work in progress. I hope I’ll get to an acceptable level of knowledge someday. Coming from AppleScript, another language I started researching and playing with earlier this year, the great thing about Python is that it’s surprisingly easy to pick up and understand. As someone whose job primarily consists of writing, I set out to find how Python could improve my workflow based on text and Markdown; I found out – and I’m still finding out – that Python allows for more flexible and intelligent string manipulation[1] and that some very smart folks have created excellent formatting tools for Markdown writers.

But this article isn’t strictly about Python. Soon after I took my decision to (slowly) learn my way around it, I asked my friend Gabe Weatherhead about possible options to write and execute Python scripts on iOS. Thanks to Gabe’s recommendation I installed Pythonista, and this app has completely changed my iOS workflow. (more…)

Oct
22
2012

I communicate with my team through iMessage. We’ve tried many “communication services” over the years, yet, since last Fall, we’ve always come back to Apple’s solution. It’s not perfect for us, its reliability is far from 100%, but it works.

As we keep using iMessage every day, there’s one category of “media” we’re constantly sharing: Twitter URLs. We find some cool piece of information or news on Twitter, we share it with the team. Linking back to tweets has, in a way, become our favorite type of commentary for fun, news-hunting, and everything in between.

Twitter.com URLs, though, aren’t the best way to jump back to a tweet, especially when you’re on a mobile device. When you’re on a Mac, clicking on a Twitter link will open a new browser tab, which doesn’t really bother us as we’re used to opening background tabs on our computers. But on the iPhone and iPad, it can become annoying: there’s a limit of 8 Safari tabs on the iPhone, you get yanked out of Messages, and, most of the time, mobile.twitter.com URLs just don’t work. In our team chat, we’ve speculated the “Not Found” errors we’ve seen may be related to how Tweetbot generates Twitter URLs when you hit “Copy Link to Tweet”: instead of using status in the URL slug, it uses statuses, which seems to be the reason behind erroneous redirecting on mobile devices.

We’ve come to the conclusion that we want to be able to easily copy twitter.com URLs and turn them into links based on Tweetbot’s URL scheme. Using a simple tweetbot:// URL, you can use Twitter’s status ID – the same you receive when you copy a link – to open a single tweet directly in Tweetbot. And the best part is, the same URL scheme works consistently across Tweetbot for iOS and Tweetbot for Mac. As everyone on the MacStories team is already using Tweetbot, the solution seemed obvious – plus: no more browser tabs.

The problem was finding a way to convert twitter.com URLs easily, without having to remember complex combinations of keystrokes and commands. Furthermore, as I promised my team I’d come up with a way, I had to figure out a solution to do text conversion directly on iOS.

As a result, I’ve come up with an AppleScript, a Keyboard Maestro macro, and a simple Python script to transform Twitter URLs into their Tweetbot counterparts. (more…)

Two days ago, Ben Brooks asked on App.net if anyone had come up with a way to share Safari Reading List items to Instapaper. His question made me realize that it would be a fun project to find out, so in my free time I put together a workflow that runs automatically and in the background on my Mac mini.

Please note, what follows is a raw experiment. I have tested it, and it works, but it’s far from stable. It uses GUI scripting in AppleScript to mark Reading List items as read, and it heavily depends on iCloud, which, unfortunately, is far from reliable when it comes to bookmark syncing. Nothing should happen to your bookmarks (the script simply “reads” them), but backups are recommended, as usual. (more…)