Work around for one of my Leopard annoyances

OS X is a funny system. So many things are very simple and yet there are some things that are more difficult than they need to be. Take for example mapping or mounting network shares. In Tiger (10.4) you could mount a share and it would show up in the sidebar. With Leopard (10.5) this isn’t so, you have to manually add it. This addition to the sidebar will stick until you reboot the system. This is a bit annoying. I like having direct access to the root of my share.

Fortunately OS X ships with automator and either I didn’t notice this in the previous version or it really is new but you can now call shell and apple scripts directly. I was already using automator to mount all of the shares I want mounted on login but I needed a way to get them into the sidebar. Click through to see my solution.

My original automator work flow consisted of nothing more than two finder commands called Get Specified Servers followed by Connect to Servers. The Get Specified Servers contained a list of shares I wanted to mount. These shares included \\mythtv\raid, \\mythtv\web and \\mythtv\backup. This has served me well but to get my mounted shares visible on the sidebar I needed to add in a bit of AppleScript using the Run AppleScript action.

on run {input, parameters}
	
	tell application "Finder"
		activate
		delay 1
		select folder "raid"
		tell application "System Events" to tell process "Finder" to keystroke "t" using command down
		select folder "web"
		tell application "System Events" to tell process "Finder" to keystroke "t" using command down
		select folder "backup"
		tell application "System Events" to tell process "Finder" to keystroke "t" using command down
		tell application "System Events" to tell process "Finder" to keystroke "w" using command down
	end tell
 

Hopefully others will find this useful. If so please leave some comments

Leave a Reply

Your email address will not be published. Required fields are marked *