On 10/13/02 5:56 PM, "Jeffrey Berman" <[EMAIL PROTECTED]> wrote:
> For a script I'm writing I need to get the content of a selected message > *and* the headers displayed when the message window is open (not the full > Internet headers). > > I know I can get the text of the message with the "content" property of a > message and I can get the full Internet headers with the "headers" property. > I could also go through a long process using properties such as "sender", > "time sent", "display name of address of recipient", "address of address of > recipient", "type of recipient", "and "subject" to reconstruct the displayed > message header. > > Anyone know if there is a simpler way in AppleScript to obtain the headers > displayed when the message window is opened? It's pretty simple. applescript isn't really designed for imitating the UI but for programming the app. The format of 'time sent' as a property (and as seen in the message pane), which is always given in your time zone, not the sender's, is different from the Date header which gives the sender's time zone and zone info (-0700 etc.). If you want the header version, you'll have to parse a variable set to 'headers', using AppleScript's text item delimiters, but that makes it rather harder to get the name and address of the recipient since there are so many "Received" headers. Instead use the properties. But 'recipient' is not a property: it's an element, since there can be several recipients. So be careful with that one. If it's an incoming message, just get the _account_ of the message, and then get the 'full name' and 'email address' of the account. That's much more reliable. -- Paul Berkowitz -- To unsubscribe: <mailto:[EMAIL PROTECTED]> archives: <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/> old-archive: <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>
