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.
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.
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, 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.
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…)
Last night, Tweetbot for iOS was updated with support for the Twitter 1.1 API, which, among various requirements, includes the need of linking a tweet’s timestamp – the date and time when it was sent – to its unique URL on twitter.com. In Tweetbot, you can now open the tweet detail view and tap on the timestamp to automatically open the Twitter website in your default browser; in terms of interaction, I like this change because it lets me open tweets in Google Chrome with just one tap.
In thinking about the update last night, I realized that:
My team and I use iMessage for daily communication;
The majority of URLs we share are Twitter URLs;
We all use Tweetbot on iOS and OS X;
Easier browser access means easier bookmarklet triggering;
Hopefully somebody else will find it useful and adapt the workflow to other similar scenarios.
Therefore, I created a browser bookmarklet, a Python script, and a Drafts action to automate the entire process and demonstrate how you can convert Twitter URLs to tweetbot:// URLs and send text from Pythonista to Drafts.
As usual, I am posting the following workflow as a proof of concept that you can modify and adapt to your needs. For instance, you can change the action that is triggered in Drafts, the x-success parameter that will be triggered, or the way Twitter links are converted to Tweetbot-specific URLs.
Browse to http://m.youtube.com in Mobile Safari, view a video that you like (press Stop if it starts playing, you need to be looking at the page – not the video actually playing), then click on “Bookmarks” and select the bookmarklet that you created.
This will launch my script, which will pull the URL of the page you were looking at as an argument, parse it, figure out the direct download URL for the .mp4 video file, then open iDownloads directly to that URL to start downloading it.
As pudquick says, third-party YouTube clients with a “download” functionality are usually removed from the App Store as Google doesn't allow downloading video files from the service. However, by using Pythonista to crawl the webpage and find the direct .mp4 link of a video, pudquick managed to put together a handy solution to go from your web browser to Pythonista and then directly to iDownloads to start downloading the .mp4 file.
However, I don't use iDownloads – I prefer Readdle's Documents and good.iWare's GoodReader. Replacing iDownloads with your favorite file manager is very easy: in the penultimate line of the script, replace the iDownloads://URL with the one of the app you want to use (the URL of the .mp4 will be appended to it). Unfortunately, Documents doesn't seem to be able to download .mp4 files in this way, but I had no problems with GoodReader. Simply use ghttp://to forward the .mp4 file to GoodReader and start downloading it automatically.
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…)
The Pythonista app is pretty simple, it’s basically crossfading between different images to show the current state of the lights. I have one layer for each state (3 lights so 2^3) and I have invisible layers that I use as buttons to trigger the lamps and transition on and off. I’m quite fascinated by the possibilities of Pythonista.
If you watch the video below, it basically looks like magic. This guy is tapping on a photo of his room on an iPad to turn the actual lights on and off. In practice, he’s using a Python library to control a Philips Hue system that reacts to touch input from Pythonista.
For those unaware of Philips’ product, Hue is a personal wireless lightning system that can be remotely controlled and programmed to offer different lightning settings and color combinations for every occasion. Philips isn’t offering an SDK for developers yet, but the Python library manages to directly connect to the Hue wireless bridge and send input commands.
As nlecaude writes, this is just a script put together in 10 minutes with an unofficial library. The possibilities for home automation programmed from an iPad are seriously intriguing.
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.