• 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: Determining when mail has been sent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining when mail has been sent


  • Subject: Re: Determining when mail has been sent
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Fri, 26 Aug 2005 11:07:35 +1000


On 26/08/2005, at 9:47 AM, Jim Brandt wrote:

As part of a script to send a message with Mail, I use the following:

        tell application "Mail" to activate
        tell application "System Events"
            tell process "Mail"
                click button "Send" of group 1 of group 1 of tool bar 1 of window thedate
            end tell
        end tell



This sends the current draft, created by another part of the script.


Your script won't work if the user has toggled the toolbar display using the button in the top right corner?

I wonder why you don't use "tell app "mail" to send message" ? As for the other bit. When you "send", the message is moved to the "Out" box and it stays there until it is sent. At that point it ends up in the "sent" box. That's what happens here, it may be different for you. Why don't you

tell application "Mail"
	set msgList to outgoing messages
	repeat with msg in msgList
		if subject of msg is theDate then
			set msgID to msg
			exit repeat
		end if
	end repeat
	send msgID
	repeat until (messages of mailbox "Out" is {})
		delay 10
	end repeat
	quit
end tell


and here's a curio

mailboxes of mailbox "sent" --> NSevaluation error
mailboxes of mailbox "Sent" --> {}

Q1. Why is this case sensitive?
Q2. Why doesn't it return references to the mailboxes in the "Sent" mailbox?


like so...
mailboxes of mailbox "a Family" --> {mailbox "a Family/Ace", mailbox "a Family/Aman" ...}



even more curious. The Out box is empty or appears to be empty, yet

messages of mailbox "Out" -- {message 1 of mailbox "Outbox", message 2 of mailbox "Outbox"}

The Drafts mailbox is displaying 2 messages, I thought there might be crossed wires, so

messages of mailbox "Drafts" --> {a very long list which is truncated in the display}
count messages of mailbox "Drafts" --> 2138


Rebuilding the mailbox doesn't change this count. That's a big number, more like total messages sent or characters in the messages, but definitely not count of messages in the "Drafts" mailbox.

and moments later, the "sent" message sound, then
messages of mailbox "Out" -- {}

Yet nothing in the "Sent" box less than twenty minutes old? Very strange.



Malcolm Fitzgerald                        email@hidden
Database Manager                          http://www.asauthors.org
The Australian Society of Authors         ph: 02 93180877 fax: 02
93180530

_______________________________________________
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


References: 
 >Determining when mail has been sent (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: Mail and Attachments
  • Next by Date: Re: Mail and Attachments
  • Previous by thread: Determining when mail has been sent
  • Next by thread: Re: Determining when mail has been sent
  • Index(es):
    • Date
    • Thread