Re: Apple Mail help sought
Re: Apple Mail help sought
- Subject: Re: Apple Mail help sought
- From: Christopher M Drum <email@hidden>
- Date: Mon, 31 Jan 2005 16:51:26 -0800
Hi Chuck,
From what I can tell of your needs,
the following code will get you going.
Mail makes it pretty easy to grab the
information you're pulling out. We just have to tell a specific mailbox
to give us the information.
In this case, I'm talking to the Mail-defined
"inbox" object. Since we're talking to a specific mailbox, we
can get it's count directly.
I didn't put any error trapping into
this, but you could certainly check "theText" to see if it even
contains any text, and ignore it if it does not.
Mail seems to perform the job with less
code than Outlook did, I think, but I might have oversimplified your needs
here.
set
theText to
"" as
string
set
theName to
"" as
string
set
theSender to
"" as
string
tell
application "Mail"
tell
inbox
repeat
with
i from
1 to
(count of
messages)
set
theText to
(content of
message i as
string)
set
theName to
"From email -- " & (subject of
message i as
string)
set
theSender to
(sender of
message i as
string)
-- This
dialog box just let's me verify that I've captured the right text. Take
it out if you're confident things are working well
display
dialog theName & return & theSender & return & theText
--Here's
your original NewsEditPro code which I can't compile since I don't own
that program
tell
application "NewsEditPro IQue"
-- tells the Baseview NewsEditPro application
to create a new story
make new story with properties {slug:theName,
status:"02 Ready to Edit", publication:"Henderson Gleaner"}
--insert text of email into the new NewsEditPro
story
make new text at the
beginning
of
story 1 with data theText
make new text at the
beginning
of
story 1 with data return
save story 1
--End
your original code
end
tell
end
repeat
end
tell
end
tell
Regards, and good luck!
Christopher Drum
System Support Manager, Macy's West
x.3563 (415-393-3563) _______________________________________________
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