Quantcast
Channel: macosxhints.com storage device tips
Viewing all articles
Browse latest Browse all 21

Mount and unmount external drives easily via AppleScript

$
0
0
I like to eject my external drives because they slow down my mac when they spin up, but I want to have an easy way to access them if I need to. I wrote a little AppleScript that will toggle the mount status of the drive (if it's mounted, it will eject, if it's unmounted, it will mount).

To run the script, use the script menu at the right of the menu bar, or bind it to a hot key using a Quicksilver-type app. Be sure to change 'YourDiskNameHere' to the name of the volume you're working with.

The script can be easily adapted to only eject, or only mount the drive. You can also tweak it to display a Mount/Unmount dialog if you wish.
set diskName to "YourDiskNameHere"
tell application "Finder"
 if disk diskName exists then
  eject disk diskName
 else
  tell current application
   set deviceL ...

Viewing all articles
Browse latest Browse all 21

Trending Articles