Re: Getting content of an HTML message in Mail
Re: Getting content of an HTML message in Mail
- Subject: Re: Getting content of an HTML message in Mail
- From: Andreas Amann <email@hidden>
- Date: Fri, 10 Dec 2004 23:41:18 -0800
I am trying to get the content of a selected message. The message is
formatted with HTML.
[...]
I get the_subject just fine, but the_content shows "?" rather than
the content of the message.
I am able to make this work (getting "source" rather than "content"):
[...]
but this gives me a lot of formatting to wade through (all I want is
the information, not the formatting). Is there a way for me to get
just the text, without the formatting, if the message is HTML?
Oh yes, the joys of AS implementation errors in Mail;-) This actually
used to work as intended in 10.2 (you would get the content of the
plain text alternative) but broke in 10.3.0 and has not been fixed -
maybe even more people need to submit this bug to Apple to get it
fixed...
The only way of dealing with this currently is indeed getting the
message source and wading through it all the extract the information
you want - Perl is your friend here!
I have written a parser for mail messages in Perl (using HTML::Parser
and Mail::Tools from CPAN) which can be implemented in an AppleScript -
I do this in the "Export Messages" script of "Mail Scripts". You might
want to take a look at the source code which is available from my web
page:
http://homepage.mac.com/aamann/
Andreas Amann
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden