Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Sunday, January 15, 2012

Quickly Launch Remote Desktop Connections on Mac OS X

At work and at home I have a few PC servers that I frequently need to remote connect to. My Mac launcher application of choice is Alfred. I wanted to be able to use it to instantly launch connections to those servers without needing to type in anything but the first few letters of the server name. Getting this setup on Mac OS X is a bit of a hassle, but here is basically what I do:
  • I use the Remote Desktop Connection Client for Mac to connect to the PC servers.
  • After installing the client and typing in the name of the server I want to connect to I go to preferences and customize the connection:
    • Under the Login tab I enter account information
    • Under the Display tab I specify my preferred remote desktop size
    • Sometimes I tweak some of the other settings, but those two are of main importance
  • Then I go to File and Save As... and save this connection as a .rdp file on my Mac
  • Now I can double-click on the file to be instantly connected to the remote server
  • Problem is that application launchers don't really know how to run .rdp files, so I want to take it a step further and create a runnable Mac Application for each .rdp file.  To do this I use an open source program called Platypus, that a coworker of mine told me about.  
  • Unfortunately Platypus does not know how to run .rdp files, but it does know how create Applications that launch shell scripts.  Hence, I create a simple shell script to launch my remote desktop connection.  E.g. if I want to launch SteiniServer.rdp, then my script would look like this:

    open "/Applications/Remote Desktop Connection.app" ~/Documents/RDC/SteiniServer.rdp

  • Then I save the script on my computer in a file called rdcSteiniServer.sh
  • Now I open Platypus and use it to create a Mac Application with the following settings:
(If you want to add a custom icon for your application you can right-click the image and choose Select Image File...)
        
The only thing that really matters is selecting Script Type Shell and the path to your script.
  • Then I hit Create and select:


  • Now I am ready to launch my remote connection with Alfred, which I do like this:
  • Basically, I activate Alfred (Ctrl-A for me) and as soon as I have typed in RDC it finds the RDC Steini Server Application and when I hit enter I am automatically logged into the remote PC server without having to type in anything else.

    If you have a simpler way of achieving the same I am eager to hear :-)

    Saturday, January 1, 2011

    Easily Size and Arrange Windows on Mac OS X

    One idiosyncrasy of Mac OS X is that application windows can only be sized from their lower right corner, and Mac OS does not have any kind of "snap windows into place" feature similar to Windows 7.  At work I have the pleasure of working on a large 27" iMac screen, so I frequently arrange two apps side by side while working, or might even have more than 2 apps visible on the screen at any given time.   Arranging that kind of setup is tedious when done manually with the mouse, but with a nifty little tool called Divvy the task becomes quite easy.   As can be seen in the Divvy in Action video on their site, when activated, Divvy overlays a grid on your screen and can be used to visually size an application to a specific portion of the screen.  That is great, but what I found faster and easier was to assign global OS X shortcuts to window arranging operations I frequently use and let Divvy do its magic without bringing up the grid panel at all.  Creating shortcuts is covered towards the end of the video, but to make them global you need to check the "Global Shortcut" check box.  Here is a screen shot of some of the configurations I set up:


    For example if I need to have an application fill the left 50% of my screen I just hit ctrl-shift-1 (with the app in focus) and it will jump right into place.  While developing, I often arrange things so that my IDE uses the entire right-side of the screen, the website I am testing covers the upper left-side of the screen and the application sever console (logging output) covers the lower left-side.  To put the windows in place I simply put them in focus one at a time and hit ctrl-shift-2, ctrl-shift-3 and ctrl-shift-4, in that order, and the apps snap into place, filling the screen like this:


    No space is wasted on the screen and no annoying mouse-dragging operations are needed. Of course you can assign whatever keyboard shortcuts make sense to you.
    Divvy is not freeware, but low cost, and can be used in demo mode (periodically pops up a registration message) if you don't want to cough up the $14.  It supports multiple monitors and is available for Windows too.