Re: Looping through a mailbox?
Re: Looping through a mailbox?
- Subject: Re: Looping through a mailbox?
- From: Andersen Studley <email@hidden>
- Date: Thu, 8 Jul 2004 00:28:15 -0700
You guys are amazing.
Much, much obliged.
Andersen
On Jul 8, 2004, at 12:09 AM, Andrew Oliver wrote:
You're right, it is a simple fix.
The issue is that you're trying to iterate through theBox:
repeat with ThisMessage in theBox
Where 'theBox is a mailBox:
set theBox to mailbox "comments"
The problem is that theBox represents the mailbox, not necessarily the
items
in it. Consequently AppleScript interprets your script as trying to get
content of mailbox "comments", or sender of mailbox "comments", etc.
Instead, what you need to do is iterate through the *messages* of the
mailbox.
Just change the line:
repeat with ThisMessage in theBox
to:
repeat with ThisMessage in (every message of theBox)
That way you'll walk through the messages in the mailbox, which do have
contents, senders, etc.
Andrew
:)
On 7/7/04 11:55 PM, "Andersen Studley" <email@hidden> wrote:
Hello List,
Hoping to lean on your help yet again... I've made tons of progress
with your infinite wisdom and guidance.
Simply put, I would like to loop through a mailbox and perform actions
on each message.
Previously, I've been using the following for a single message :
on perform mail action with messages theMessages
repeat with ThisMessage in theMessages
so, I tried
set theBox to mailbox "comments"
repeat with ThisMessage in theBox
tell application "Mail"
set TheContent to content of ThisMessage
set TheSender to sender of ThisMessage
set TheSubject to subject of ThisMessage
which brings forth errors. (seemingly at the first "content" keyword,
at least it ends up highlighted)
A simple fix, I'm sure, I just don't have my head around applescript
quite yet.
Many Thanks for any help you can give
Andersen Studley
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.