Create Youtube Embed Code from a Regular Watch Link

I am wondering what would be a good way to do the following with Keyboard Maestro:

I have a youtube link such as: http://youtu.be/nJvicFzK9xc

and I would like to convert it into the embed code for the same video, such as:

iframe> width="560" height="315" src="https://www.youtube.com/embed/nJvicFzK9xc" frameborder="0" allowfullscreen>

What would be the best way to achieve this with Keyboard Maestro.

Thank you in advance.

Just copy the selected link, and set the clipboard.
It is then ready for you to paste wherever you'd like.

The key is in using the %CurrentClipboard% token, in the Set Clipboard To Text Action:

iframe> width="560" height="315" src="%CurrentClipboard%" frameborder="0" allowfullscreen>

If the link is in the clipboard, then this macro should accomplish it.

Keyboard Maestro “Youtube embed” Macro

Youtube embed.kmmacros (3.5 KB)

Nice!!! Thank you. I knew you all would be able to help me. So simple!

I am closing this topic as it is a spam magnet. If anyone has anything constructive to add, let me know.