12/23/2023 0 Comments Tnefs enough version 3I have this as app in the applications folder and a shortcut defined in the launcher Butler.įeedback and ideas, how to improve the script (e.g. If you want to edit the script, just open winmail.app in the Applescript Editor. The script can be downloaded as zipped application bundle ( ) containing the tnef tool ready to use. "Unpack" cancel button name "Cancel" with empty selection allowed)ĭisplay alert "Files unpacked to folder" & linefeed & theOutputFolder (choose from list theFiles with title "Files in Attachment" OK button name ¬ Set end of theFiles to item 1 of (text items of f) # just for fun: make a list of contained files Set cmd2 to (POSIX path of tnefPath) & " -f " & theSavePathĭisplay alert "There are no files in winmail.dat!" Set cmd1 to (POSIX path of tnefPath) & " -t -f " & theSavePath Set cmd to "cd " & (POSIX path of theOutputFolder) & linefeed # tnef is supposed to be in the given folder Set theSavePathMsg to POSIX path of (theOutputFolder & (id of m as text) & "message")ĭisplay alert "Could not save winmail.dat" & linefeed & "at " & theSavePath ¬ Set theSavePath to POSIX path of (theOutputFolder & (id of m as text) & (name of a)) # save an existing winmail.dat to the given folder & linefeed & "nor in Applications folder" "in the Script Bundle" & linefeed & "nor in " & theOutputFolder ¬ Set tnefPath to ((path to applications folder) as text) & "tnef"ĭisplay alert "Could not find tnef" & linefeed & ¬ Set tnefInfo to properties of alias tnefPath Set tnefPath to ((path to me) as text) & "Contents:Resources:tnef" # temporary save winmail.dat and unpack contained files # in this folder the file operations take place: Set theOutputFolder to (choose folder) as text If not (name of a as text) = "winmail.dat" thenĭisplay alert "Selected Mail has no winmail.dat attachement" Set a to ( get first item of ( get mail attachments of m))ĭisplay alert "Selected Mail has no Attachement" # check attachement for existence of winmail.dat Set m to ( get first item of ( get selected messages of first message viewer))ĭisplay alert "Please select a Mail with winmail.dat Attachement" # Mail should be open and a mail selected It is developed and tested on Mac OS X 10.6.7 with latest app software. The script works best, if at scriptstart already a mail containing a winmail.dat attachment is selected. the script's bundle/Contents/Resources (in case it is an. Places the script checks for the tnef tool: If one of the checks fail, the script stops with a message. unpack the contained files to the folder ![]() check for attachment files in winmail.dat save the winmail.dat to the given folder let user choose a folder for the unpacked attachments check wether a mail is selected in Mail.app A good explanation about the TNEF format: So I started to learn, what's behind this "Microhard" and finally found Mark Simmon's tool tnef. I tested tnef's enough, but it did not always work and I love little helpers, that can be hidden behind one click or a keyboard shortcut. Since some month, I got more and more mails born in Outlook, that contained this ugly attachment named winmail.dat, that does not easily show it's contents. Problems with winmail.dat attachments ( ) The idea for this script was born, when I found this post at Apple Support Forum:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |