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


Click here to return to the 'A contextual menu item to unmount parttions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A contextual menu item to unmount parttions
Authored by: syzygies on Jan 18, '06 10:40:31AM
Here is an AppleScript snippet for extracting this name:

try
	set a to do shell script "diskutil list | egrep '^ +[[:digit:]]+: +[[:graph:]]+ +" & diskname & " +[.[:digit:]]+ GB +disk[[:alnum:]]+$'"
	do shell script "diskutil mount `echo '" & a & "' | sed 's/" & diskname & "//' | awk '{print $5}'`"
on error
	return false
end try

Most code has issues with spaces in volume names, or volume names containing other volume names as substrings. The above search pattern matches entire lines of the diskutil listing, then removes the name, to avoid these problems.

[ Reply to This | # ]