He usado este script, envuelto como una aplicación, para expulsar con éxito las unidades USB 'pegajosas' & Tarjetas SD ...
Fuente, MacTipper , créditos dejados en su lugar en el script.
property show_credits : true
set the_volumes to do shell script "ls /Volumes/"
tell application "Finder" to set the_HD to path to home folder as string
set ejectable_volumes to {}
repeat with i in (every paragraph of the_volumes)
if the_HD does not start with i then
set end of ejectable_volumes to (i as string)
end if
end repeat
if (count of items of ejectable_volumes) is 0 then
tell me to activate
display dialog "Sorry, but there are no ejectable volumes."
else if (count of items of ejectable_volumes) is 1 then
tell me to activate
set the_result to item 1 of ejectable_volumes as string
display dialog ("Eject \"" & the_result & "\"?") buttons {"No", "Yes"} default button 2 cancel button "No"
set the_path to quoted form of ("/Volumes/" & the_result as string)
do shell script "hdiutil eject -force " & the_path
else
tell me to activate
set the_result to choose from list ejectable_volumes with prompt "Please choose a volume to eject (You can select multiple items):" with multiple selections allowed
if the_result is not false then
repeat with j in the_result
set the_path to quoted form of ("/Volumes/" & j as string)
do shell script "hdiutil eject -force " & the_path
end repeat
end if
end if
if show_credits is true then
tell me to activate
set the_credits to button returned of (display dialog "This applescript brought to you by The MacTipper Blog.\n\nhttp://mactipper.com" buttons {"Don't Show Again", "Visit TMB", "OK"} default button 3) as string
if the_credits is "Don't Show Again" then
set show_credits to false
else if the_credits is "Visit TMB" then
open location "http://mactipper.com"
end if
end if