view_attachement.sh - update

I updated the script to work on OSX 10.8.3 and added some OS Detection script.
'file' has no -i option under Darwin (anymore?) but still uses it under Linux.