The output is pictured above: everytime I want to share a link from Safari to another app, I tap a “Share” button in Safari and I’m presented with a list of actions from Launch Center Pro. The list conveniently comes up in the middle of the screen with large buttons I can tap to send a link off to Tweetbot, Fantastical, Drafts, and other apps. The action menu works on both the iPhone and iPad and, more importantly, it doesn’t require you to install any additional Launch Center Pro action because it’s a “headless” bookmarklet that isn’t actually based on any Launch Center Pro action.
The single-line code you can save as a bookmarklet in Safari is available on GitHub; however, you’ll want to modify the bookmarklet for your needs, so here’s how it looked in Drafts when I was editing it:
A a multi-line code breakdown with comments is also available as a GitHub Gist to give you a better idea of what’s going on in the bookmarklet.
The solution that I employ to launch a list not based on an existing action is to “trick” Launch Center Pro into linking to itself. Using the
launchpro://?url= URL scheme twice, you can tell Launch Center Pro to open a Launch Center Pro URL to display a list. I don’t know why I couldn’t simply launch the app and tell it to display a list without nesting two levels of URL schemes, but that’s how it is. You’re telling Launch Center Pro to open itself.
Actions are the core part of the bookmarklet, and they’re formatted according to Launch Center Pro’s list syntax. Each section is separated by a pipe (vertical bar) and URL schemes are used to send the URL you’re viewing in Safari to other apps. As you can see, there’s a lot of manual encoding due to the multiple levels of URL schemes the bookmarklet needs to use.
I made two simple tweaks to the standard list presentation that I’m quite fond of. First, the URL you’re sharing is displayed in the title of the list: it’s not a great solution because Launch Center Pro cuts off long URLs, but it’s better than nothing. Second, I made actions a little more visual by using emojis next to their names. Again, not perfect (it’d be great if Launch Center Pro could pull in small app icons for URL schemes in lists) but color helps.
I made a video that demonstrates how the action menu works.
There are several ways in which this action menu could be improved. Having to manually create and edit the bookmarklet isn’t a good user experience, and perhaps someone could come up with a better way to assemble the necessary URL schemes. I didn’t implement support for x-callback-url in my actions (you can see that I return to Safari manually) because that would have required additional levels of encoding, but I suppose it’s doable. I had to remove support for sharing webpage titles, because sending those to Launch Center Pro created the possibility that pages with a pipe in their title could mess with the lists’ syntax.
If you have suggestions or other feedback, feel free to get in touch.