Re: [OE] Which Incoming Message triggered Rule?
Re: [OE] Which Incoming Message triggered Rule?
- Subject: Re: [OE] Which Incoming Message triggered Rule?
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Jan 2001 18:51:50 -0800
On 1/3/01 2:23 PM, "Frank Watzl" <email@hidden> wrote:
>
Hi,
>
>
in Outlook Express 5, I'd like to do the following
>
>
1-User checks mail (either manually or scheduled)
>
2-Some of the incoming messages meet the criteria of an Outlook Express Rule,
>
which is set up to run an AppleScript
>
3-The AppleScript triggered by the rule acts on the messages which met the
>
rule's criteria <<-- Problem here!
>
4 -In particular:the AppleScript exports the messages to a *Finder*-Folder
>
(NB: not OE Mail Folder) as a single Message file, naming it as (text 1 thru
>
31 of ((subject of message) & (Date/Time stamp))) or the like.
>
>
I am stuck with Number 3: How can I let the Script know, *which* incoming
>
message triggered the OE Rule, which in turn triggered the Script. I see, that
>
for each message meeting the rule's criteria, the script is run once, which is
>
fine for me.
An OE rule filters the messages one by one, so if it runs a script, the
script will run over and over again on each message individually. (I used to
worry about traffic jams, but it seems OK: the incoming messages wait
patiently one by one for the script to run. It just makes downloading
messages pretty slow). So the script only needs to be concerned with the
message currently being filtered, which is:
set theMsg to item 1 of (get current messages)
(current messages) can also be messages selected in a folder, which is why
the plural form exists. But in a script running from a rule (current
messages) can only be the single message being filtered as a single-item
list. ***NOTE: you MUST use 'get' as above or set it to a variable if you
prefer:
set currMsgs to (current messages)
set theMsg to item 1 of of currMsgs
but I don't see the point when there's only one message.
>
>
For Number 4, I am successful in using AS's read/write commands and the Finder
>
for changing type & creator of the resulting file.
You can save theMsg to a file specification. Just use the file path string
version, because you can't use the word 'file' inside an OE tell block,
since OE has its own 'file' property (of attachment) which means something
else.
--
Paul Berkowitz