Re: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
Re: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
- Subject: Re: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 08 Jun 2006 22:18:23 -0700
- Thread-topic: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
Title: Re: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
Perhaps you are familiar with the Entourage or Outlook Express dictionary. Mail is different. (Boy, is it ever...). 'outgoing message' is not like Entourage's or OE's: it can never be a sent message. It can never be in mailbox other than a drafts folder, and AppleScript doesn't even know about that, since 'mailbox' is not a property of 'outgoing message'. You can't even specify where to make it. You need to think of it more as an Entourage/OE 'draft window'. (You could get its ID and then search through every mailbox to see if there's a 'message' whose ID is that number, but it would be extremely tedious.)
As Michele said, you need to look for a 'message' - not an 'outgoing message' that meets your criteria, mailbox by mailbox, since 'message' is an element only of 'mailbox', not of the application. (This is like Entourage/OE.) With 'every outgoing message' you will get proper references to any open, new message windows you have made manually or via AppleScript. No bug:
tell application "Mail"
set theMsg to make new outgoing message with properties {content:"", subject:"Blah3", visible:true}
set theMsg to make new outgoing message with properties {content:"", subject:"Blah4", visible:true}
set found to outgoing messages
end tell
--> {outgoing message id 4351456, outgoing message id 80001008, outgoing message id 80119792, outgoing message id 80398304, outgoing message id 4748336} -- [I had a few I made manually as well.]
If you haven't made any new message [windows], you'll get those odd references to the application.
But if you want to look for sent messages (or even draft messages in Draft folders), you need to get them as 'messages' of a particular mailbox.
--
Paul Berkowitz
From: Henry Halff <email@hidden>
Date: Thu, 8 Jun 2006 16:24:35 -0500
To: <email@hidden>
Subject: Problem with Reply, Forward and Outgoing Messages in Application "Mail"
I'm new to this list, so pardon me if this issue has come up before.
I am trying to manipulate outgoing messages created in Mail by hand or by the applescript commands reply and forward. Here is what I find.
Neither reply nor forward return a value. Each is supposed to return a reference to the message that it creates.
The reference "outgoing messages" returns a list of n items, each of which is a reference to the application "Mail." The count, n, is 1 + the real number of outgoing messages.
The reference "outgoing message i" fails to return a value, even when i ≤ n (defined above).
These problems sure strike me as being related bugs. Am I wrong? If not, are there any workarounds?
thanks
hh
--
Henry M. Halff 210-348-9540
Halff Resources (fax) 210-568-4165
402 W. Rhapsody, Suite 110 (cell) 210-363-7501
San Antonio, TX 78216 http://www.halffresources.com <http://www.halffresources.com>
_______________________________________________
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
_______________________________________________
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