set diskName to "YourDiskNameHere"
tell application "Finder"
if disk diskName exists then
eject disk diskName
else
tell current application
set deviceLine to (do shell script "diskutil list | grep \"" & diskName & "\" | awk '{ print $NF }' }'")
if deviceLine = "" then
display dialog "The disk \"" & diskName & "\" cannot be found." buttons {"OK"} default button 1 with title "Error" with icon caution
end if
set foundDisks to paragraphs of deviceLine
repeat with i from 1 to number of items in foundDisks
set this_item to item i of foundDisks
if this_item contains "disk" then
do shell script "diskutil mountDisk /dev/" & this_item
end if
end repeat
end tell
end if
end tell
kmarkley wrote:I have forked bip.phillipe's plugin to work with local network shares. There is a new device type to accomplish this.
Users browsing this forum: No registered users and 0 guests