36 Degrees Design

The website of Stuart Frisby, a freelance web designer in Coventry and Liverpool, UK.

Automounting external devices in OSX

written by Stuart on March 11th, 2007


The problem

connectorOSX lacks any really effective method of mounting external devices. There are methods involving creating aliases, applescript, and even automator, which I'll be using to achieve my particular solution.

I have three external drives which I need regular contact with in the finder. These are my media drive, which is connected to my wireless router, a box.net account, which I connect to via webDAV, and an FTP folder on my universities network. Now obviously, I don't always need all of them, I'll often need just one, or two of the three. But I do need them regularly enough to have to find a better method than going via the finder go > connect to server command, which is time consuming. So what I want is for - on start-up - a prompt asking if I'd like to connect to each device in turn, meaning I can say yay or nay as needs determine… The below video shows the application as it works when finished, read on for the how-to


The Solution

Heres how I've done it. So, the first thing to do is to make a note of the location of the devices you want to connect to, and then get into automator and start building a workflow as follows:

  1. Search and select "Get Specified Servers", and enter the details for your chosen device. In my case, the first thing I'm going to set it up my media drive, as you can see below.
  2. Search and select "Ask for Confirmation", and create a dialog box asking if you'd really like to connect to this device.
  3. The next action you need to find is "Connect to Servers".
  4. lastly, you'll want to "Mount Disk Image", there is some redundancy here, but since I'm using this same workflow for each device, having both of the last two actions covers pretty much everything.

The workflow we just created is posted below. Once this done, save this somewhere sensible as a workflow - not as an application. Repeat this process for any other devices you might want to connect to. automator workflowBe sure to make your confirmation message make sense, and different for each device.

Ok, so now you have an workflow - created and saved - for each device you want to connect to. It would be smart at this point to test each one and make sure it actually mounts, otherwise you've done something horribly wrong and you probably made babies sad. Go back to start, do not pass go etc.

Assuming you have those applications running, we can move onto the next step, bundling these little jobs together into one bigger job. We can do this in automator too. Take a look at the image below:

automator application

All this is doing is running in turn each of those workflows. We could have ran all of these in one flow, but then once you've told the application not to launch one device, it halts instead of continuing through the workflow. We don't need to do anything special here just bear in mind the logical order you want to connect to devices in, or select them by importance/speed of availability, whatever. Once you've got that sorted, save this workflow as an application. Now you have saved this, don't go moving the workflows it depends upon, otherwise it will break.

Now locate and run the application you just created run through it a couple of times ad make sure it all works, you should be able to mount each device in turn, or choose not to mount certain devices should you wish, you'll see the process of the application in the menu bar, if it stalls for too long, quit it using the red blob, and check nothing is wrong in the application, and that you're referring to the right workflows within it.

Okay, so were nearly done. All you need to do now is to open the "System Preferences > User Accounts > Login Items", and drag in your newly created application, as I've done in the image below:

login items

You'll want to make it hidden, probably, I have and it works as I intended it to. You'll notice my application has a different icon to yours, which will be the automator logo, that's nothing special, I just pasted an icon onto the application file in the finder.

So, were all done, restart your beast, and when it comes back to life you'll get a series of prompts (as below), asking in turn if you would like to connect to each of your external devices. Awesome.

automator alert

Now you'll get your chosen devices lining up like willing henchmen on your desktop, and you can give them nicer icons too, as I've done. Whether this is of any use to anyone else in the world but me is up for debate, but I'm pretty happy to have finally sorted this out.

drive iconsObviously you'll need to be connected to the internet to connect to ftp accounts, and you'll need to be in the right place to get into your NAS media drive. This whole thing can probably be streamlined, I'm certainly no automator expert, but the joy of it is that you don't have to be in order to make little applications of workflows like this one. I hope you managed to follow this, I might have a go at sticking a demo video online at some point.

Tags: , , , , , ,

Popularity: 3%

Who cares what everyone else thinks? (RSS)

gravatar On March 11th, 2007 Luke Dorny said

Nice writeup, buddy!

Something to say...

Then add a comment why dont ya!

FYI: Your email address will not be published. You may use basic HTML in your comments.

Posted in: Mac, Productivity

Historical archive. This is a preserved copy of 36 Degrees Design (2005–2008), the early web-design weblog of Stuart Frisby. It is maintained independently as a piece of web history and is not operated by, affiliated with, or endorsed by Stuart Frisby. If you are the original owner and would like this domain returned, get in touch — it’s yours, no fuss.
Article Archive