Probier das, es sendet auch eine Notification wenn ein Fehler auftritt

Show Plain Text
  1. set startupDisk to boot volume of (system info)
  2. set allDisks to list folder "/Volumes"
  3. repeat with aDisk in allDisks
  4.   try
  5.     if contents of aDisk is not startupDisk then do shell script "/usr/sbin/diskutil unmount " & quoted form of ("/Volumes/" & aDisk)
  6.   on error
  7.     display notification "The disk " & aDisk & " couldn't be unmounted" with title "Unmount Error"
  8.   end try
  9. end repeat
----------
Gruss

Stefan