Mount partitions like a boss (AppleScript)

How to quickly mount partitions when the need arises? A small AppleScript to help you out.

The need

No good comes without little drawbacks. When I swapped ODD with HDD, I noticed that it was quite a bit noisier than SSD and even compared to similar MBP with HDD in original bay (probably because ODD bay has a slot that lets noise out easily). So, now I tend to eject the secondary disk when I don’t need it, so my Mac can spin it down. All nice and dandy, but reattaching it when needed was a bit tedious.

The Script

set partList to {"Meedia", "BOOTCAMP"}
choose from list partList with prompt "Choose partitions" with multiple selections allowed
if result is not equal to false then
	repeat with part in result
		do shell script "diskutil mount " & part
		display dialog "Volume " & part & " mounted"
	end repeat
end if

This script asks for which of the partitions to mount and then iterates with diskutil through the selection.

Download

You can copy-paste the above script to AppleScript Editor and adjust it to your needs, or you can download this as a ready to use application.

MountPartitions.zip

 

Be Sociable, Share!

Leave a Comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current ye@r *