• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Move message to another mailbox behaves erratically?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move message to another mailbox behaves erratically?


  • Subject: Re: Move message to another mailbox behaves erratically?
  • From: Michael Heinz <email@hidden>
  • Date: Fri, 7 Mar 2003 16:26:04 -0500

On Friday, March 7, 2003, at 04:04 PM, cricket wrote:

It's hard to say for sure without seeing the construction of the CategoryList structure. My guess would be that my_messages is matching all messages or a bigger subset than you are expecting, which is leading to results that look like corruption in the my_messages variable.

Try to figure out if my_messages truly contains the messages you expect it to contain.

- cricket


Cricket,

The catgegorylist is a list of lists;

property CategoryList : { { "user1" , "mbox1" } , {"user2" , "mbox2"} ... }

I'm pretty sure the my_messages list is correct, because if I *don't* actually move the messages, the display dialog shows exactly the expected results. If I uncomment the set mailbox of my_message statement, then the first entry moves okay but subsequent entries show unexpected results in the dialog.

I've encountered the same behavior when I create a list of messages older than a certain date. The script ran, but many inappropriate records were moved and many appropriate records were left behind, before it finally died with an "internal error":

-- age in days.
property ArchiveAge : 14
property ArchiveBox : "Archive"

tell application "Mail"
set today to current date
set archive_date to today - ArchiveAge * days
set my_archive to mailbox ArchiveBox

repeat with my_account in (imap accounts & pop accounts)
set my_inbox to mailbox "INBOX" of my_account
set message_list to (every message in my_inbox whose date sent is less than archive_date) as list
display dialog "Archiving " & ((count of the message_list) as string) & " messages from " & ,
((name of my_account) as string)
repeat with my_message in message_list
set mailbox of my_message to my_archive
end repeat
end repeat
end tell
_______________________________________________
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.
References: 
 >Re: Move message to another mailbox behaves erratically? (From: cricket <email@hidden>)

  • Prev by Date: Re: Move message to another mailbox behaves erratically?
  • Next by Date: Re: [SE2] Script to copy selection for mail
  • Previous by thread: Re: Move message to another mailbox behaves erratically?
  • Next by thread: Re: Move message to another mailbox behaves erratically?
  • Index(es):
    • Date
    • Thread