Automate a YouTube Embed Code on Your iOS Device With Drafts, TextTool, and Launch Center Pro

Tweet This Post

Over the weekend I wanted to embed a video on my blog while on my iPad. The mobile YouTube site did not appear to offer an embed code, so I created a few actions to automate the process.

As an example, here is the starting URL

This browser bookmarklet -- I call it "TextTool Split" -- imports the URL into Drafts and triggers the "split" action:


The "split" URL action sends the URL to TextTool and splits the URL at the =.


Import it here into Drafts.

The above action takes the original URL and creates a new draft:


It then triggers the line2-youtube action, which takes line 2, sticks it in the YouTube embed code, and saves all of that to the clipboard with the help of Launch Center Pro:

launch://clipboard?text={{<iframe width="560" height="315" src="//[[line|2]]" frameborder="0" allowfullscreen></iframe>}}

Import it here into Drafts.

The result will be that the following is added to your clipboard, and you can paste it into your blog CMS:

<iframe width="560" height="315" src="//" frameborder="0" allowfullscreen></iframe>

This action presumes that there are no additional paramaters in the URL. If your URL has something like &list= after the video ID, you will either have to manually remove that string or create an extra Drafts/TextTool action to split the results of line 2 at the & and to take line 1 of that output.

Last built: Thu, Oct 16, 2014 at 2:47 PM

By Jeffrey Kishner, Monday, June 30, 2014 at 9:03 AM.