Alfred is an award-winning application launcher and productivity tool for macOS.

I first switched to Alfred in 2011, when looking for a simpler alternative to Quicksilver. Alfred is now the first application I install on a new Mac and is the primary way I interact with macOS. On average, I active Alfred 41 times per day, covering everything from opening files, switching system functions, triggering the workflow, as well as launching applications and websites.

One handy feature of Alfred is Snippets, which allow you to save frequently used text clips and expand them automatically via a keyword. A limitation of Snippets is that they do not support rich text, which means adding hyperlinks can be cumbersome.

Alfred

As an example, Microsoft recently released Teams, their Slack competitor and Skype for Business replacement. The tool is currently still very immature and lacks some basic functionality, for example, the ability to create a personal meeting link that can be shared via a third-party application.

As this is a feature I use a lot with other collaboration tools, I decided to create a Snippet which would automatically create and share a human-readable Teams meeting link.

As Alfred Snippets do not support rich text, I was forced to leverage an Alfred Workflow, which are an incredibly powerful way of extending Alfred functionality.

The workflow itself is incredibly simple:

  1. Wait for Keyword “tmeet”.
  2. Open a rich text file and copy the contents to the clipboard.
  3. Paste the contents into the active window.

The image below shows the end-to-end workflow.

Alfred

The “Run Script” action includes two lines of AppleScript. The first highlights the path of the rich text file. The second copies the contents to the clipboard.

Alfred

The full script can be found below:

set theFilePath to "/Users/<username>/Documents/Scripts/Teams.rtf"
set the clipboard to (read theFilePath as «class RTF »)


Finally, do not forget to create a rich text file and include the content you wish to paste. In my example, this was a hyperlink that points to a Teams meeting URL.

Alfred

That’s it! The workflow is activated any time I type the keyword “tmeet”. If you are interested, the full Alfred Workflow is available on GitHub.