• 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: Mail's Sent Messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail's Sent Messages


  • Subject: Re: Mail's Sent Messages
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 09 Jun 2009 08:52:50 -0500

On Jun 8, 2009, at 9:08 AM, I wrote:
On Jun 4, 2009, at 4:13 PM, I wrote:
It's worse than I thought. If you UNCHECK the "Store sent messages on the server" box, then Quit Mail, then Launch Mail, you will find the "Store sent messages on the server" box again CHECKED. In other words, it doesn't mean a thing!

This is a bug in Mail and I have bug-reported it.

I was trying to understand why it was so difficult to construct the path to a message file, when I was interrupted by this problem. (It ought to be easy to do this.) I originally thought the problem had nothing to do with AppleScripting, however.

When I returned to my script, I discovered precisely why I was having difficulty constructing a path to a message file and it's directly related to the problem that I bug-reported. The following script will illustrate the problem, provided you have an imap (Me) account to test it on.

I have appended this script to Bug ID# 6954718.

(*
This script illustrates a problem with Mail's mailboxes and accounts. (Leopard 10.5.7)

If the selected mailbox is "On My Mac", there is no account name or directory (understandable),
yet, getting its account does not error. (Why?)

If the selected mailbox belongs to a POP account, then the name, account name and directory all exist.

If the selected mailbox belongs to an imap (Me) account and the mailbox is under the heading Inbox or under the account heading,
then the name, account name and directory all exist.
But if the mailbox is under the heading Sent, Trash, Junk or Drafts, then there is neither an account name nor an account directory.
*)

tell application "Mail"
activate
set frontViewer to (some message viewer whose index is 1)
set mailBoxList to (selected mailboxes of frontViewer) as list
if (count items of mailBoxList) ≠ 1 then return
--
set mbox to (item 1 of mailBoxList)
set mailboxName to (name of mbox) as text
try
set acnt to (get account of mbox) -- OnMyMac OK; pop OK; imap OK.
on error
display dialog mailboxName & return & "[has no account]"
return
end try
try
set acntName to (name of acnt) as text
-- no error if imap account is inbox or user mailbox or pop account
on error
set acntName to "[No Name]"
-- error if imap account is sent, trash, junk or drafts
end try
try
set acntDir to (account directory of acnt) as text -- OnMyMac errors; imap errors except inbox and TEST; pop OK.
on error
set acntDir to "[No directory]"
end try
"Mailbox name = " & mailboxName & return & return & "Account name = " & acntName & return & return & "Directory = " & acntDir
display dialog the result
end tell -------------------------------------


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Mail's Sent Messages (From: Luther Fuller <email@hidden>)
 >Re: Mail's Sent Messages (From: Joel Esler <email@hidden>)
 >Re: Mail's Sent Messages (From: Luther Fuller <email@hidden>)
 >Re: Mail's Sent Messages (From: Luther Fuller <email@hidden>)
 >Re: Mail's Sent Messages (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Problem creating new mailbox
  • Next by Date: System Info oddity
  • Previous by thread: Re: Mail's Sent Messages
  • Next by thread: Password Assistant
  • Index(es):
    • Date
    • Thread