This Week's Sponsor:

1Blocker

A Cleaner, Faster, and More Private Web Experience


Posts tagged with "URL Scheme"

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



Chaining Tweetbot, Pythonista, Drafts, and iMessage for URLs

DraftsMessages

DraftsMessages

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;
  • Drafts can access iMessage.

And I concluded that:

  • I could chain every piece of the puzzle together;
  • 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.

Read more


iOS YouTube Downloader with Pythonista

iOS YouTube Downloader with Pythonista

Useful script created by “pudquick” on the Pythonista forums:

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.

Make sure to check out pudquick’s explanation of the script and bookmarklet here. For our previous coverage of Pythonista, check out our tag page and my original review.

Permalink

Alex Guyot Chains 5 Apps with Drafts

Alex Guyot Chains 5 Apps with Drafts

As I expected, people have started experimenting with chaining apps and services using Drafts, and Alex Guyot quickly beat me in chaining 5 apps. From his explanation of the workflow:

Follow the bookmark in Chrome and it will take the URL of the webpage you are on, send it to Drafts as a draft, upload it to Dropbox, send it to Due (where you choose a reminder time for it to remind you), take you back to Drafts, send you to Instapaper (Where you choose to save the link to Instapaper), then send you back to Chrome.

He also posted a quick video showing the workflow in action on his iPad. I like how, unlike me, he chained each action as an x-success parameter of the previous one.

As I’ve argued on multiple occasions here on the site, URL schemes are certainly a stopgap solution to a problem – better inter-app communication on iOS – that I wish Apple will tackle in the near future. However, that doesn’t mean people can’t get real work done with URL schemes and apps today. Looking ahead, I can only imagine new possibilities of iOS automation based on URL schemes that, however, abstract the need of manually building URLs from the end user’s workflow – using a more Automator-like interface to visually represent actions. And, who knows, perhaps in a future version of iOS “switching” between apps won’t even be required anymore, as “parts” of other apps will be linked to each other using something like XPC.

Permalink

Chaining Multiple Apps Together with Drafts

A few weeks ago, I took a look at the automation possibilities opened by Drafts, Agile Tortoise’s multi-purpose text app. In the article, I mentioned how a bug prevented Drafts from “linking to itself” more than once:

Therefore, my idea for cross-posting was: I can link to Drafts itself, and if the first action is successful, I can link to Drafts itself again. Essentially, I wanted to leverage the built-in App.net and Twitter actions to avoid the use of any third-party app. Unfortunately, there’s a bug in the current version of Drafts that doesn’t make that kind of action work.

With an update to Drafts released yesterday, Greg Pierce has brought various improvements to the app, including support for more customizable timestamps and dates using strftime, date and time tags for file names and URL actions, and a new way to encode strings with curly brackets.

Seemingly minor, the option to more easily URL encode strings is actually a very welcome addition: like in the latest Mr. Reader, instead of forcing the user to encode a URL into a longer string, you can simply put a URL inside {{ }} and let Drafts take care of encoding it. It means I can now experiment with building more complex workflows that contain actions for more external apps and, more importantly, for “sequential” tasks in Drafts itself. Easier encoding means we construct URLs that will tell Drafts “do this, and then do that” in a single workflow.

Those who follow me on Twitter know that I’ve been trying since yesterday to see how many apps I could chain together in a workflow, mainly out of curiosity and as a “proof” of concept. First, I tweeted about a Mr. Reader -> Drafts -> Poster workflow that would take selected text from an article, convert its Markdown to HTML, and then send it to Poster; the workflow consisted of three apps chained together, but I knew I could try to accomplish something a bit more ambitious. I kept on experimenting with Drafts URLs, and eventually I managed to build a single workflow with 3 apps and 4 different tasks involved. I’m posting it here for two reasons: a) I believe it’s a quite useful workflow; and b) it can serve as an example of what Drafts can do when you understand how to properly link multiple apps together. Read more


Poster Adds Improved URL Scheme and 1Password Integration

Poster is my favorite iOS app to post articles to WordPress. I recently took a look at version 2.0 and the improvements developer Tom Witkin made to further streamline the app’s posting workflow. Today, Tom released another update that adds support for custom fields to the URL scheme and brings 1Password integration.

Like other apps have done in the past weeks, Poster now sports a 1Password button when setting up a new site that requires authentication. The button will take you directly to 1Password, searching for “wordpress” by default. Once you’ve found your login item, you can copy the password and go back to Poster. I believe this sort of non-forced integration is really nice and ultimately beneficial to the end user, as it makes using multiple apps for a single task less cumbersome. Read more


Pinbook 1.3

Pinbook is my favorite app to create and manage Pinboard bookmarks on iOS. Developer Collin Donnell released version 1.3 of the app today, which includes support for Google Chrome, x-callback-url, more editing options, and browsing tags.

Tag browsing is probably the biggest new feature in this update. You can tap on a new button in the bottom toolbar to bring up a Filter menu containing a search bar, shortcuts for Private/Public/Unread/Untagged bookmarks, and an alphabetical list of all your Pinboard tags. Each tag shows the number of existing bookmarks assigned to it in your account and can be tapped to view them in the main screen. To go back to viewing all bookmarks without browsing by tag, you can enter the screen again and select Clear Filter. You can also tap & hold a tag to share its Pinboard URL.

I like how you can select multiple tags, but I wish the app was capable of showing me results that matched all criteria, rather than any of them; for instance, I often browse a page that contains bookmarks tagged with “python” and “pythonista”, while Pinbook will show it as “python” or “pythonista”. It’s a minor difference that I’m sure Collin will consider.

Bookmarks can now be edited from the Bookmarks screen. Hitting Edit will open an editing interface to modify single bookmarks or multiple ones at once if you want to delete them or make them as read. You can now also tap & hold a bookmark to quickly show an Edit/Mark as Read/Share menu.

My favorite new feature of version 1.3 is the addition of x-callback-url and support for opening links in Chrome. Thanks to x-callback-url, a link opened in Chrome will show a “Pinbook” button to go back to the app (shown above); with x-callback-url built-in, you can also construct URLs that will take you back to other apps after a bookmark has been added. Therefore, I update my Safari and Chrome bookmarklets to take advantage of the new functionality.

Safari

javascript:window.location='pinbook://x-callback-url/add?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&x-source=Safari&x-success='+encodeURIComponent(location.href)+'&x-cancel='+encodeURIComponent(location.href)

Chrome

javascript:window.location='pinbook://x-callback-url/add?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&x-source=Chrome&x-success=googlechrome://&x-cancel=googlechrome://'

You can imagine the sort of workflows that are made possible by x-callback-url. Just to name two: you could create a Mr. Reader service that sends selected text from an article to Pinbook as description (alongside title and URL) and then goes back to Mr. Reader; or, you could create a Launch Center Pro action that sends a URL in the clipboard to Pinbook and then launches the Pinboard website in Safari or Google Chrome.

Pinbook continues to be one of my most used iOS apps. Version 1.3 is available on the App Store.


Gmail for iOS URL Scheme

Gmail for iOS URL Scheme

Tom Scogland figured out the complete URL scheme for Gmail 2.0, Google’s official Gmail app for the iPhone and iPad. As documented on his blog, the Gmail app allows you to compose an entire message using the following template:

googlegmail:///co?subject=<subject text>&body=<body text>

As I’ve also found out, you can add a to= parameter to pass a URL-encoded email address to which an email will be sent to. Unfortunately, my tests also confirmed that a similar from= parameter isn’t supported, and that this undocumented URL scheme doesn’t support x-callback-url, unlike Chrome. So, it’s not possible to return to a “calling” app after an email has been sent or the compose screen dismissed. I’ve also noticed how this URL scheme isn’t particularly reliable at bringing up the compose screen if the app wasn’t paused in the background (such as in a cold start); this is probably the reason Google isn’t publicizing this URL scheme – it’s not ready yet.

I’ve still made some stuff for it, though. Here’s a JavaScript bookmarklet that will open Gmail using a webpage’s title as Subject and URL as body:

javascript:window.location='googlegmail:///co?subject='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(location.href);

Here’s an action for Launch Center Pro:

googlegmail:///co?subject=[prompt]&body=[prompt]

And an action for Drafts:

googlegmail:///co?subject=[[title]]&body=[[body]]

Keep in mind that the URL scheme may fail if Gmail wasn’t paused in the background (it’ll show a splash screen when loading again). I’m looking forward to improvements to the URL scheme, as Google has been doing a great job with these lately.

Permalink