On 2010-09-24 16:33 , LuKreme wrote:
On Sep 23, 2010, at 14:27, [email protected] wrote:

On 2010-09-23 13:37 , Rudolf O. Durrer wrote:
In the Finder, the information window of an ".emlx" (email) file
displays additional infos about the email itself, mainly when it was
send, the name the sender and the one of the adressee. This information
is far better than the name of the email file itself, which is just a
number.

Does anybody know a way to extract this information by means of an
applescript?

yeah, the files are basically:

line 1: message length
line 2 through length from line 1: message content
everything else: a plist you can ignore

what you seem to want is trivially formatted in the headers of the message (so 
you can ignore parsing the MIME formatted content);

I believe the finder is not parsing the file for this info.

right, Finder's displaying info from the Spotlight index; i didn't have a technique for this on the front of my brain, but it turns out it's pretty concise:

  on get_emlx_subject(a_file)
    set the_result to ""
    if kind of (info for a_file) is "Mail Message" then
      set the_path to quoted form of POSIX path of a_file
set the_result to do shell script "mdls -raw -name kMDItemSubject " & the_path
    end if
    return the_result
  end get_emlx_subject

  set a_file to choose file
  get_emlx_subject(a_file)


_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to