"Automate everything. […] Whether you use something as simple as shell scripts or full-featured solutions such as Ansible, Puppet, Chef, or Salt, just don’t rely on any manual intervention."

The Pragmatic Programmer , David Thomas & Andrew Hunt

Alfred Workflows

Alfred is a MacOS utility app which helps boost your efficiency and productivity.

Part of the Alfred Powerpack is an excellent feature called Workflows which essentially allows you to automate anything and everything you do on a Mac.

Open your current Chrome tab in a new window

A task I often find myself doing is moving my current Chrome tab to a new window.

Typically this is useful when I am reading a blog post, article or online course material and want to write some notes on it using Notion or Roam – also in another tab in my browser.

Ideally, I would like to move my current tab to a new window allowing me to view the article and my notes side by side.

Clearly this is a very simple task but it involves taking my hands off my keyboard, hauling my mouse to the top of my screen, dragging the tab out of the window and then returning to the keyboard to type. Clearly far too much effort but easily automated.

Below is the Applescript I use in an Alfred Workflow which takes my current Chrome tab and extracts it to a new window.

The script sets a variable called currentURL to the URL of the active Chrome tab. It then closes the original tab, opens a new Chrome window and sets the new window tab to the original tab’s URL.

Note: The script closes the original tab and loads the webpage fresh in the new window. Therefore you will lose the current state of that tab. Not ideal, but it works for my use case – YMMV.

That’s all today, happy coding!

Resources

Further Reading