From mboxrd@z Thu Jan 1 00:00:00 1970 From: grant@antiflux.org (Grant Hollingworth) Date: Thu, 29 Nov 2007 11:22:10 -0500 Subject: [sup-talk] mailcap for os x Message-ID: <1196351498-sup-4803@spooky.local> run-mailcap(1), which sup uses to view attachments, doesn't exist on OS X. I used the mime-decode hook to monkey patch Attachment.view! to also use the mime-decode hook. A case statement works as a pretty good replacement for my simple .mailcap. view_attachment[1] uses file(1) to figure out what an attachment's extension should be, before passing it to open(1). For quicklook I went another way, converting from the MIME type to the OS X UTI[2] using mime2uti, an ugly little program I made. It's messy, but seems to work for my attachements. [1] http://filibusta.crema.unimi.it/~gufo/files/view_attachment.sh [2] http://en.wikipedia.org/wiki/Uniform_Type_Identifier -------------- next part -------------- A non-text attachment was scrubbed... Name: mime-decode.rb Type: application/octet-stream Size: 957 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071129/ab231270/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: mime2uti.m Type: application/octet-stream Size: 763 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071129/ab231270/attachment-0001.obj