This Week's Sponsor:


Ensure that if a device isn’t secure it can’t access your apps.  It’s Device Trust for Okta.

Screen Sharing For Alfred Brings VNC To Your Fingertips

Screen Sharing is a feature built into Mac OS X for remotely controlling another computer through the use of virtual network computing (VNC). Apple’s native screen sharing client is buried in the operating system making it nearly impossible to find the app when you actually need it. On top of that, it really lacks basic features like being able to store a connection for future use. Due to these shortcomings, most people turn to third party applications for managing their VNC connections. A quick search in the Mac App Store will turn up some pretty great options including Edovia’s Screens. Although apps like these work extremely well, not everyone wants to spend that much to easily connect to a remote computer. This is why I created the Screen Sharing for Alfred extension. I wanted Alfred to be able to function as my VNC client and really extend the functionality of the Apple’s native Screen Sharing app.

Screen Sharing for Alfred adds the ability to store information about VNC connections and quickly access them with a simple keyboard command. It is written in a beautiful fusion of shell scripting and AppleScript so it is fast, efficient, and capable of interacting with the user through AppleScript’s GUI prompts. It also incorporates David Ferguson’s genius Extension Updater system in case any new features are added in the future. For those unfamiliar with Updater, it is an extension for Alfred that allows developers to make bug fixes and add new features to released extensions – then when users run Updater, it will download the latest version of any extensions that have updates available.

Getting Started


Since it is a shell script, you may have to give it permission to run on your computer. This can be done quite easily from the Terminal by changing directories to the Screen Sharing for Alfred folder that was added to your ../Alfred/extensions/scripts/ directory and issuing this command:

chmod +x

The keyword to trigger this extension is vnc but I am not going to type that before each of the commands I list here. You can also find all of these commands and more by using the vnc help command. Now let’s take a closer look at some of the functionality that this extension provides.

Add - After you install the extension this will be the first command you want to run. Aside from displaying the help window, the extension won’t let you do much until you add some information about a host. You will be prompted by a window asking you to give the host a name. This can be anything you want it to be.

Next you will enter the address of the host. This is the information that is actually used by Screen to connect to the host. This can be an IP address or bonjour hostname as shown below.

Hit OK, and now that host is stored in Alfred for future use. You will also see a nice Growl notification to let you know that the host was successfully added to the list.

Connect - After adding some hosts to the extension, you are going to want to use the connect command to start a Screen Sharing (VNC) session. Type connect, hit Enter and you will be prompted with a nice GUI list of available hosts to choose from. Select one and hit the Connect button (or just double-click on the host name).

The address of your stored VNC host is then passed to OS X’s native Screen and a session is started.

Remove - You may eventually need to remove a host from the list. To do this you can simply type rm or remove, either one will work. You will be prompted with a GUI list of stored items. Select one and hit the Remove button.

Open - Not every VNC session is with a host you want to save so I added the open command for this situation. This command simply opens Screen which allows you to type in a quick address and connect. I may add the ability to pass the address from Alfred as a second variable in the next version.

List - To get a quick view of what hosts are stored in your Screen Sharing extension simply type ls or list and a Growl notification containing your hosts is displayed.

Kill All - Finally, to completely blow out all stored connections and start fresh, I added the killall command. A confirmation prompt will prevent you from erasing them all by accident. You will see a Growl notification to let you know they were successfully removed.

This is quickly becoming my favorite extension because I am using it all the time. I use VNC everyday at home and work so this extension was forged out of necessity which ultimately made it even more awesome. I am really excited to share it with you folks and I hope you’ll find it useful as well. Also, it should go without saying but you do need a PowerPack license for Alfred to use Screen Sharing for Alfred. If you don’t already have one, just head over Alfred’s website and pick one up today. It is worth the price.

Download: Screen Sharing for Alfred

Unlock More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.