Script to mount firewire drive

Howdy,

I’m attempting to write a simple script that will mount my FireWire drive similar to the way Disk Utility does it with the mount command. I’ve tried diskutil’s mountDisk command in the shell but it doesn’t appear to work (or I’m hosing the syntax).

Can someone help me out here? It doesn’t seem like this should be difficult but I’m falling flat on my face. :oops:

[OS X 10.2.8, BSD and Developer Tools installed]

Thanks,
Rob

Hey Rob. I’m on the road and don’t have a FireWire drive to test but on Monday I should be able to try some code. Hope you can wait the weekend or figure it out.

Jon

Yup, I can wait. There’s absolutely no rush on this. Thanks!

– Rob

Sorry, I forgot about this. Does this help?

set the_disks to paragraphs of (do shell script "disktool -l | grep hfs")
set {disk_ids, disk_names} to {{}, {}}
set OLD_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to "'"
repeat with this_disk in the_disks
	set this_disk to text items of this_disk
	set end of disk_ids to text item 2 of this_disk
	set end of disk_names to text item -2 of this_disk
end repeat
set AppleScript's text item delimiters to OLD_delim
set chosen_disk to (choose from list disk_names) as string
if chosen_disk = "false" then return
repeat with i from 1 to (count of disk_names)
	if (item i of disk_names) = chosen_disk then
		do shell script "disktool -m " & (item i of disk_ids)
		return true
	end if
end repeat
return false

This requires that the disk is an HFS volume and that it has been previously mounted and then unmounted.

HTH,
Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Thanks, Jon. The script works perfectly.

– Rob