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:
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.
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.