On 23/12/04 1:58 pm, "revDAVE" <[EMAIL PROTECTED]> wrote:
> my goal: is to be able to highlight one or more messages in the in-box,
> then apply a rule which will create a special reply to all from a certain
> account.
>
> so far, I have created the rule which works fine. However, I am not able
> to change the account automatically.
>
> At present, I have to go to the out-box and manually select those messages
> and after selecting one more messages in the out-box, run the script below
> which will change the account to: [EMAIL PROTECTED] ( which is an active
> account)...
>
> I tried adding the AppleScript below to the original rule, however it does
> not work. it does not produce an error, so I guess it�s working somewhat,
> but not changing the account.
>
> Q: Is there some way to alter this script so that I can edit to the
> original rule - to make this all a one step process?
>
> CURRENT RULE:
> - REPLY (set reply text to bla bla bla)
> - run this applescript (not working)
>
>
> the script...
>
>
> tell application "Microsoft Entourage"
> set selectedMessages to current messages
> -- if there are no messages selected, warn the user and then quit
> if selectedMessages is {} then
> display dialog "Please select a message first and then run this
> script." with icon 1
> return
> end if
> repeat with theMessage in selectedMessages
> -- Assume theMsg is a reference to the message
> set account of theMessage to POP account "[EMAIL PROTECTED]"
> end repeat
> end tell
>
>
That script will set the account of the selected message to your new
account, AFTER the reply has been created. You really need to either set the
account of the message before replying (in which case the reply will inherit
the account if the prefs are not set to 'always use default account') or to
create the reply and then set the account of the draft message window.
Either way will work.
This script will do the first method:
tell application "Microsoft Entourage"
set selectedMessages to current messages
-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this
script." with icon 1
return
end if
repeat with theMessage in selectedMessages
set account of theMessage to POP account "[EMAIL PROTECTED]"
reply to theMessage
end repeat
end tell
Note that this script also generates the reply, so you can remove that
action from the rule. This allows you to run the script directly on selected
messages, rather than running a rule (although the script will also work
from a rule if you wanted it to apply automatically on incoming mail).
--
Barry Wainwright
Microsoft MVP (see http://mvp.support.microsoft.com for details)
Seen the All-New Entourage Help Pages? - Check them out:
<http://www.entourage.mvps.org/>
--
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/>