Posts tagged with "pythonista"

Pythonista 1.5: Custom Interfaces, matplotlib, and No More “Open In”

Pythonista 1.5, the latest version of Ole Zorn's Python interpreter for iOS, has been released today on the App Store, bringing new modules, native integrations, UI refinements, and the removal of the Open In feature to comply with Apple's App Store guidelines. Pythonista 1.5 is another fantastic update to one of the most powerful and flexible iOS apps ever made, and it follows in the footsteps of Editorial 1.1, released last month.

Read more


My iOS Screenshot Generation Workflow

Screenshots

Screenshots

I didn’t think that complaining about iOS status bars on The Prompt would result in Dr. Drang going on a vision quest to produce better screenshots with Python. But I’m glad that I took the time to point out my dislike for messy status bars, because it led the good Doctor to work on some great scripts to automate the entire process with Python, which are compatible with Pythonista for iOS.

I waited to share my workflow for automated screenshot cleaning/generation because I wanted to see where Dr. Drang would end up with his script, Cleanbar. Now that he appears to have settled on a solution that requires standalone image files to act as partial status bar replacements, I think it’s the right time for me to share how I produce iPhone and iPad screenshots for MacStories.

The first step is to set up Cleanbar. I don’t need to repeat what Dr. Drang already explained, but to sum up: grab a black status bar, crop it to get two files similar to Drang’s, then run a script to pack those images as strings. Once set up, you’ll be able to a) use Cleanbar to clean single images picked from the Camera Roll with Pythonista and b) integrate it as cleanbar in other scripts to clean status bars programmatically.

As for my needs:

  • I usually need to combine two iPhone screenshots side-by-side in a single image as you can see in most reviews on this site;
  • I may or may not need to clean their status bars;
  • I don’t have to combine iPad screenshots. I only need to resize them and I may or may not have to clean their status bars;
  • Occasionally, I want to produce a banner with three screenshots (like this one), which can have original or cleaned status bars;
  • Sometimes, I only need to clean one screenshot out of two;
  • I always need to upload the final image to a Dropbox folder, which is monitored by Hazel.

And, because I’m not an animal, I wanted to automate all of this. The scripts that you’ll find below are the result of late night tweaking and lots of tests; they probably aren’t the most elegant or “Pythonic” way to handle this kind of image generation, but they work for me and they make me save several minutes every day. I haven’t been generating review screenshots manually in months, and they’re more flexible than my old workflow based on Keyboard Maestro.

Read more


Automate iOS Contacts, Location Services, and Open In Menu with Pythonista 1.4

Pythonista 1.4

Pythonista 1.4

Pythonista is the app that changed my iOS workflow a year ago. A Python interpreter with native access to iOS system features like photos, URLs, and interface elements, Pythonista allowed me to convert the scripts and macros that I was using on OS X to the iPad, automating iOS in better and sometimes unexpected ways. Pythonista eventually led to Editorial, also developed by Ole Zorn, which changed the way I write and work on my iPad every day.

Pythonista 1.4, available today on the App Store, is the biggest update to Zorn’s app to date. It includes a new UI for iOS 7 (the app is also iOS 7-only starting today), new modules and enhancements to existing ones, and, more importantly, it doubles down on iOS integration by bringing native support for contacts, location, and Open In. Read more


Fixing iOS Screenshot Status Bars with Python

Dr. Drang:

On last week’s episode of The Prompt, Federico went off on a rant about ugly iOS screenshots. He wasn’t complaining about the apps themselves being ugly, he was chastising those of us who post screenshots with status bars showing inconsistent times, signal strengths, and battery levels. And Lord help you if your battery icon is in the red.

His recommendation was Status Magic, a Mac app that cleans up the status bars in your iOS screenshots and makes them uniform. It looks like a nice app, but my thoughts gravitated toward a script using the Python Imaging Library. Why would I write a script when an inexpensive app is available?

Fixing iOS status bars is one of the reasons I need to use my Mac with Status Magic because there is no similar app on iOS. I am playing around with Dr. Drang's script, which can be easily adapted to Pythonista and integrated with the app's photos module for Camera Roll integration. Putting together status bar replacement images that match Apple's ones is a bit of work (it's tricky to get the fonts right, but now I'm trying this) and they won't produce good results with blurred status bars, but those are the same inconveniences that iOS 7 brought to Status Magic anyway.

I'm looking forward to seeing what tweaks and improvements the Doctor will make to his script. Once I have a good solution for Pythonista (which I already use to combine screenshots on iOS), my iOS writing and editing workflow for text and screenshots will be largely similar to the OS X one (I still need a good uploader for Cloud Files and an iOS version of this).

Permalink

Check Dev Center Status From iOS with Pythonista

A great idea by reader Nicolas Hoibian, which uses BeautifulSoup to fetch the source code of Apple's System Status page, parse it, and print it with custom fonts and colors in Pythonista's console.

Here's my modified version that uses Pythonista's notification module to re-run the script every 6 hours by firing a local iOS notification on your iPhone or iPad (it assumes the script is named "DevCenter" in Pythonista).

Permalink


Resolve Short URLs with Pythonista on iOS

Clean URLs

Clean URLs

I don’t like it when third-party apps or services force me to share links to articles or webpages using their own custom shortened links. I understand the appeal of personalized short domains – after all, we tweet mcstr.net links with the @macstoriesnet account – as they can provide analytics to track clicks, can save characters, and, at least in theory, they “look cool”. However, I’ve been long considering the idea of dropping our mcstr.net links, but I think the issue is worse (and more annoying) for apps and services that don’t tweet links to their own content (like we do) but that override others’ links with different domains. An example is Pocket, which gives you the clean, original URL when you choose the “Copy Link” action from the sharing menu, but that instead returns pocket.co links when sending text to Drafts (which I do often). I’ve grown tired of this practice (in Pocket and other services), and I’ve put together a workflow based on a Python script that allows me to easily resolve short links without having to open the browser and tap on multiple menus. Read more


A Better Chrome To Safari Bookmarklet

pythonista

pythonista

In January, I tried to put together a bookmarklet to send the webpage currently open in Google Chrome for iOS to Apple's Safari. That turned out to be a surprisingly complex effort as Google didn't think offering an “Open In Safari” option would be a good idea, and the app's URL scheme produced some interesting results when opening and closing Chrome.

I was reminded of the bookmarklet this morning by reader @CNWLshadow, and I realized that I never posted the solution I settled with. It consists of a browser bookmarklet and a Pythonista script, and it works with just one tap.

Read more


Send Multiple Tasks To OmniFocus Mail Drop At Once With Drafts and Pythonista

Send Multiple Tasks To OmniFocus Mail Drop At Once With Drafts and Pythonista

Nice workflow by Nathan Henrie to send multiple tasks to OmniFocus at once using Mail Drop, Drafts, and Pythonista:

I’ve also recently started playing with Pythonista, and I came across a Python script written by the dev himself that creates a little SMTP server and sends email directly from Pythonista. Between the two, I found it pretty easy — even for a beginner like me — to put together a combined Drafts / Pythonista workflow that makes for a superior way to import a bunch of tasks to OmniFocus at once (aka “brain dump”).

The Python part is based on the same script I covered in November to send emails through Pythonista; Nathan added a clever Drafts integration by splitting multiple lines (from the draft) into separate email messages sent to your Mail Drop address. Make sure to check out his video to see the workflow in action; I have started using it myself and I like how fast tasks go from Drafts onto OmniFocus via email (I have configured the script with my Gmail address using 2-step verification).

I have become a big fan of OmniFocus Mail Drop. It's been extremely fast and reliable in my experience, and it works well with Drafts' email actions.

Permalink

Create and Share Evernote Notes With Pythonista On iOS

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. Read more