Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Two AppleScripts for unmounting, mounting local disk volumes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Two AppleScripts for unmounting, mounting local disk volumes
Authored by: oschrenk on May 15, '12 07:59:04AM

Great scripts!

Would you be able to post a version of this script that just unmounts all local mounted disks without the dialog box? My use case is that I I have one hdd with two partitions that I regularly mount (and unmount), no need for me to select which one.

Another idea would be to use growl when the disks are successfully unmounted.



[ Reply to This | # ]
Two AppleScripts for unmounting, mounting local disk volumes
Authored by: llee on May 15, '12 10:15:05AM

The 2nd script only unmounts local volumes as long as any besides the boot volume remain mounted, so it does what you want, unless everything is already unmounted. If you want to defeat its mounting ability, just remove everything between the last "else" and "end if".

I don't know about Growl. I stopped using when it stopped being free. Anyway Mountain Lion will have that feature, so I might wait.

As far as any other notification that all the local volumes have been ejected, I'll have to think about it. Other's might be able to contribute that more readily.



[ Reply to This | # ]
Two AppleScripts for unmounting, mounting local disk volumes
Authored by: designr on May 15, '12 12:18:18PM

tell application "Finder"
eject (every disk)
end tell



[ Reply to This | # ]
For Quicksilver: Two AppleScripts for unmounting, mounting local disk volumes
Authored by: morespace54 on May 15, '12 12:21:30PM
If you use Quicksilver, you could add:

tell application "Quicksilver" 
    show notification "Volumes unmounted." 
end tell 
or

tell application "Quicksilver" to show large type (Volumes unmounted.)
end tell 
Edited on May 15, '12 12:22:18PM by morespace54


[ Reply to This | # ]
Two AppleScripts for unmounting, mounting local disk volumes
Authored by: oschrenk on May 16, '12 08:49:08AM
Thanks for the input! For now I'll use this:

tell application "Finder"
	eject (every disk)
end tell

tell application "System Events"
	set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell

if isRunning then
	tell application id "com.Growl.GrowlHelperApp"
		set the allNotificationsList to {"Eject Disk Notification"}
		set the enabledNotificationsList to {"Eject Disk Notification"}
		
		register as application 
			"Growl Eject Disk Notification" all notifications allNotificationsList 
			default notifications enabledNotificationsList 
			--       Send a Notification...
		notify with name 
			"Eject Disk Notification" title 
			"Eject Disk Notification" description 
			"Ejected all disks." application name "Growl Eject Disk Notification" icon of application "Finder.app"
	end tell
end if


[ Reply to This | # ]