I had exactly the same problem with my car stereo, 1 file /2 is unplayable, because the player considers that the dot file created by MAC OS is a music file...
Then I found this post really useful, thanks.
So I come back now with an improved and free solution for Mavericks:
- Create an Automator Application to run an AppleScript script
Use this script:
on run {input, parameters}
try
tell application "Finder" to set allDrives to the name of every disk whose local volume is true and startup is false
set driveName to {choose from list allDrives with title "DiskCleaner" with prompt "Disk to Clean and Eject:" OK button name "Clean and Eject" cancel button name "Abort"} as text
set getDriveIdentifier to "diskutil info " & quoted form of driveName & " | grep Ident | awk '{print $3}'"
set driveIdentifier to do shell script getDriveIdentifier
try
do shell script "find /Volumes/" & quoted form of driveName & " -name '.DS_Store' -type f -delete"
do shell script "find /Volumes/" & quoted form of driveName & " -name '.FBC*' -type f -delete"
do shell script "find /Volumes/" & quoted form of driveName & " -name '._*' -type f -delete"
do shell script "rm -rf /Volumes/" & quoted form of driveName & "/.{,_.}{fseventsd,Spotlight-V*,Trashes}"
display notification "Disk Cleaned"
on error
try
do shell script "sudo find /Volumes/" & quoted form of driveName & " -name '.DS_Store' -type f -delete" with administrator privileges
do shell script "sudo find /Volumes/" & quoted form of driveName & " -name '.FBC*' -type f -delete" with administrator privileges
do shell script "sudo find /Volumes/" & quoted form of driveName & " -name '._*' -type f -delete" with administrator privileges
do shell script "sudo rm -rf /Volumes/" & quoted form of driveName & "/.{,_.}{fseventsd,Spotlight-V*,Trashes}" with administrator privileges
display notification "Disk Cleaned"
on error
display notification "Can't Clean, Permission Denied"
end try
end try
delay 1
try
do shell script "diskutil eject " & driveIdentifier
display notification "Disk Ejected"
on error
display notification "Can't Eject, Disk in Use"
end try
on error
display notification "No Disk to Clean and Eject"
end try
end run
Save the application as DiskCleaner.app for example
This script will ask you to choose the USB disk to clean and eject. Then it will clean the USB disk (tries with admin credentials if failed with current ones), then eject if possible.
Of course there is still some place for improvement, I did this script for myself!
Also you have the flexibility to add code lines for cleaning more files.
Enjoy!