Start Screen Sharing or Apple Remote Desktop Sessions with Spotlight

Screen Sharing is a really useful tool in Mac OS X. Most people use it locally and select the Computer from the Sharing area in the Finder sidebar. You can also connect Screen Sharing to a remote host. In Finder select “Connect to Server” from the “Go” menu and enter

vnc://host.example.com/

which will connect Screen Sharing to the address. ((It will use VNC on TCP port 5900 in case you have connection issues.))

You could add the vnc URI to the favorites in the “Connect to Server” dialog, but there is a better way: Screen Sharing remembers the last connections in ~/Library/Application Support/Screen Sharing/. There you will find the hosts you have connected to as .vncloc files. Find the host(s) you use most frequently and copy them to the Desktop or your Documents folder. ((anywhere Spotlight will index)) Then rename them to just the hostname or another descriptor. You can now double-click to initiate the Screen Sharing connection. But even better: you can invoke Spotlight, start typing the hostname and the vncloc file should be right there. No matter what you are doing the remote session is just a few keystrokes away.

However, if you prefer to use Apple Remote Desktop over Screen Sharing, this will not work. ARD does not open vncloc files. However, ARD is scriptable, so we can build a workaround. Even better ARD supports Automator, so we don’t even need to write code.

  • open Automator. From the template chooser, select “Application.”
  • add the action “Choose Remote Computer” and select a computer to connect to. ((The computer has to be already known to the local Remote Desktop to appear in this list.))
  • add the “Observe Computers” action next. ((curiously enough there is no “Control Computers” action, but switching from observe to control is only a single click. This may be so you cannot accidentally invoke a remote control session.))
  • you’re done. Save this Automator applet and give it the name of the computer.
  • you can start this applet by starting to type the computer’s name in Spotlight and you will a remote observe session in Remote Desktop.

Create more applets for each host you frequently use. if you select multiple computers in the first action, you will get the nice “multi observe” window in Remote Desktop. Or you can replace the “Choose Remote Computers” action with a “Choose Computer Lists” action.

Published by

ab

Mac Admin, Consultant, and Author

3 thoughts on “Start Screen Sharing or Apple Remote Desktop Sessions with Spotlight”

  1. When using ARD for remote management
    .vncloc file is still generated in ~ / Library / Application Support / Screen Sharing.
    However file.vncloc remains in the recent ARD shows menu (from the right mouse button on ARD app dock) as a recent window.
    And there’s no way to remove it!
    Is there a solution to avoid this?

    1. I don’t really know what you mean, I can see none of these files (or folders) on my system? Either when using Remote Desktop or Screen Sharing.

  2. This happens when Apple Remote Desktop!
    I use it on a wi-fi network, maybe I’m wrong?
    Can not post a picture? So maybe I can better explain what happens to my system.

Comments are closed.