Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

powerhouse7

macrumors regular
Original poster
Oct 21, 2009
132
0
Canberra, Australia
Hi, a few days ago I bought a LaCie 2tb d2 Quadra. I'm finding it's a lot louder than anything else is my setup (very distracting) so I keep mounting and unmounting my hard drive all the time. This doesn't bother me too much but I do hate having to keep going into finder and disk utility to mount and unmount the hard drive.

So I was wondering if there is a way I could use the blue Shortcut Button on the front of the drive to activate either an actionscript or shell script or something that could mount the drive if it's not mounted, or unmount if its already mounted.

I've already done some googling and I know there are a few scripts out there, but I couldn't find any definitive script that could detect the state of the drive, then mount or unmount it accordingly.

Any help is much appreciated.
Thanks in advance
:apple:
 
For now, this seems to work:
I've put together two actionscripts I found into one, then set the shortcut button to activate the script. Seems to be working for now.
Where i've written "Insert Disk Name" you would change to the name of the hard drive you want to unmount/mount as it appears in Finder.
Here is the script I'm using:

tell application "Finder"
if not (exists the disk "Insert Disk Name") then
do shell script "diskutil mount `disktool -l | grep 'Insert Disk Name' |
sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
delay 2
else
eject "Insert Disk Name"
delay 2
end if
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.