Re: HTML email results in "??????????" when captured
Re: HTML email results in "??????????" when captured
- Subject: Re: HTML email results in "??????????" when captured
- From: "Patrick Collins" <email@hidden>
- Date: Sun, 3 Jul 2005 14:30:40 -0700 (PDT)
- Organization: Collinator Studios
I tried doing that, and I got "can't get item 2 of "x-apparently-to:<my
email>via <my ip>; sun 03 jul 2005.. etc etc etc.. basicallly the raw
source of the email all listed out".
I'm curious if doing this copy-paste in text-edit is a good idea or
not.. thoughts?
-patrick
John M wrote on 7/3/05, 2:25 PM:
> Hi Patrick,
>
> If in the raw source has a "text/plain;" alternative, adding the
> "multipart/mixed" type to the "if myContentType begins with..." line
> should work.
>
> John M
>
> On 3 Jul 2005, at 22:14, Patrick Collins wrote:
>
> >
> > Thanks John... This isn't working though because if I look at the raw
> > source, it says:
> >
> > Content-Type: MULTIPART/MIXED; BOUNDARY=12306-846930886-1119712742-553
> >
> > should I just add a "or myContentType begins with "multipart/mixed" ?
> >
> > -patrick
> > John M wrote on 7/3/05, 1:45 PM:
> >
> >
> >> Hi Patrick,
> >>
> >> If the email has a "text/plain;" alternative you should be able to
> >> parse it.
> >>
> >> This works for the (few) paypal emails I have received.
> >>
> >> --
> >> tell application "Mail"
> >> set theseMessages to selection
> >> set thisMessage to item 1 of theseMessages
> >> set myContentType to content of header "content-type" of
> >> thisMessage
> >> set mySource to source of thisMessage
> >> end tell
> >>
> >> if myContentType begins with "multipart/alternative" or myContentType
> >> begins with "multipart/related" then
> >> -- problems with nested multipart types
> >> set {myTID, AppleScript's text item delimiters} to
> >> {AppleScript's text item delimiters, {"boundary="}}
> >> set myBoundry to (text item 2 of myContentType) as text
> >> set AppleScript's text item delimiters to {"\""}
> >> set myBoundry to (text items of myBoundry) as text
> >> set AppleScript's text item delimiters to {"text/plain;"}
> >> set myText to text item 2 of mySource
> >> set AppleScript's text item delimiters to {myBoundry}
> >> set myText to text item 1 of myText
> >> set AppleScript's text item delimiters to myTID
> >> end if
> >> myText
> >> --
> >>
> >> Best wishes
> >>
> >> John M
> >>
> >>
> >>
> >> On 3 Jul 2005, at 20:01, Patrick Collins wrote:
> >>
> >>
> >>>
> >>> Hi, I am trying to capture the text of a paypal email within
> >>> mail.app
> >>> using:
> >>>
> >>> tell application "Mail"
> >>> set theseMessages to selection
> >>> set thisMessage to item 1 of theseMessages
> >>> set myText to (content of thisMessage) as text
> >>> end tell
> >>>
> >>> however, the result since the paypal email is HTML mail, myText
> >>> becomes
> >>> "??????????????????????????????????"
> >>>
> >>> and that's it..
> >>>
> >>> Does anyone have any suggestions on how I can convert HTML email to
> >>> standard text for the purposes of this capture?
> >>>
> >>> -patrick
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
>
_______________________________________________
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