Re: AppleScripting Outlook Express 5.02 on Mac OS 9
Re: AppleScripting Outlook Express 5.02 on Mac OS 9
- Subject: Re: AppleScripting Outlook Express 5.02 on Mac OS 9
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 06 Dec 2001 20:20:39 -0800
On 12/6/01 6:54 PM, "Andrew Duncan" <email@hidden> wrote:
>
I'm trying to write an AppleScript that grabs data from an Outlook Express
>
message and sends it to a FileMaker Pro database. I have the script running
>
on a message that is open in it's own window successfully, what I would like
>
however is to have the script run on a message that is selected/highlighted
>
in the inbox or other folder so that it can be run on a mail rule. The
>
script is as follows:
>
>
---
>
>
tell application "Outlook Express"
>
set myMessage to the displayed message of the front window
>
set senderAddress to sender of myMessage
>
set messageEmail to (address of senderAddress)
>
set messageBody to (source of myMessage)
>
end tell
It can run on a selected message, or on several, by using
set theMessages to (current messages) -- a list
and then do a repeat loop. or else just on one selected message by
set theMessage to item 1 of (get current messages)
(You need the explicit 'get' or else first set a variable to 'current
messages').
As it happens, you can use the same syntax (item 1) for a mail rule _rather
than_ selecting a message.
BTW, (source of myMessage) won't get you just the message body - it will
get you all the headers, encoded attachments, everything. To get just the
message body, use
set messageBody to content of myMessage
--
Paul Berkowitz