Need Some Help? Have a Tip to Share?

Email me at MacTipper@gmail.com, or, leave a comment!

Subscribe To Our FREE RSS Feed!

Don't miss out on any posts from the Concise MacTipper Blog.

Friday, September 18, 2009

Eject All Disks With One Click

I have written a simple AppleScript to eject all mounted volume except your boot drive. The text of the script is:


property exceptions : "iTunes Disk" --Add exceptions here.

set the_items to do shell script ("ls /Volumes/")

tell application "Finder"
repeat with each_volume in (every paragraph of the_items as list)
set each_volume to each_volume as string
set the_path to (":Volumes:" & each_volume) as alias
if the_path is local volume then
if the_path is not startup disk then
if exceptions does not contain each_volume then
eject the_path
end if
end if
end if
end repeat
end tell

0 comments:

Post a Comment