Re: Entourage -> rule -> attachments
Re: Entourage -> rule -> attachments
- Subject: Re: Entourage -> rule -> attachments
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 04 Nov 2003 11:56:47 -0800
On 11/4/03 8:32 AM, "julifos" <email@hidden> wrote:
>
Hi all!
>
>
I'm working in a script for Entourage, attached to a rule, where I need work
>
with attachments, but seems that they doesn't exist when the script is fired
>
by an incoming message. The rule is as follow:
>
>
IF
>
if subject is "x" then
>
>
THEN
>
run applescript "x"
>
>
And applescript "x" contains this code:
>
>
########################
>
tell app "Entourage"
>
set msgs to (current messages)
>
set msg to item 1 of msgs
>
set msgAttachments to attachments of msg
>
>
repeat with i in msgAttachments
>
display dialog (name of i)
>
end repeat
>
end tell
>
########################
>
>
And nothing happens when the message *has* attachments.
>
>
So, seems that Entourage fires the "Run AppleScript" event before the
>
message was entirely downloaded, and it owns all its properties except for
>
attachments? Do you know a workaround for this, so "applescript x" can see
>
the attachments?
>
No, that's not correct. Entourage fires the rule only when the message is
downloaded and enters the Inbox. Only if you have POP account settings
(Tools/Accounts/Mail/[the account]/Options) set to "Partially receive
messages over [20 KB]" will the attachments not be included. That's a
setting you can change by AppleScript if you need to.
There are several other possibilities here:
1. You're referring to
app "Entourage"
when the correct name is
app "Microsoft Entourage"
unless you've renamed it. Have you?
2. 'name' is actually Unicode. In Entourage X and earlier, it's supposed to
automatically switch to string for AppleScript if you don't specify 'as
Unicode text' (that will be revised in a later version of Entourage) but
just possibly that's not happening here. Just to be sure you could change
that line to
display dialog (name of i as string)
display dialog is still somewhat iffy about Unicode extracted from
application terms here, even in Panther.
3. You have a Rule higher in the Rules list that either moves messages or
runs another script on this message, or simply has the checkbox "Do not run
other rules on messages which meet these criteria" checked. (You can't
uncheck it for rules that move messages or run scripts.) Move this rule
above them in the list - they run top to bottom. Or you may want to add it
as an Action to those other rules, if the Rule logic fits. You can run
several actions, including moving and running scripts, within one rule.
4, If you saved the rule in Script Editor 1.9 or 2.0, or as a Data Fork
script in Script Debugger or Smile, make sure that you have upgraded to at
least Entourage 10.1.2 (and go all the way to Office 10.1.5 once you're at
it). Before 10.1.2 (more or less coincident with Jaguar), data fork scripts
didn't exist and the Entourage Script Menu didn't recognize them as scripts.
I just tested your script (with the correct app name and 'as string') on
some messages with attachments that I sent to myself, and it works just fine
from a POP Mail Rule running the script in the Entourage Scripts menu.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.