Automounting external devices in OSX
written by Stuart on March 11th, 2007
The problem
OSX 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:
- 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.
- Search and select "Ask for Confirmation", and create a dialog box asking if you'd really like to connect to this device.
- The next action you need to find is "Connect to Servers".
- 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.
Be 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:

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:

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.

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.
Obviously 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.
Popularity: 3%
Nice writeup, buddy!