Re: Problems scripting MS Entourage
Re: Problems scripting MS Entourage
- Subject: Re: Problems scripting MS Entourage
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 02 Nov 2001 08:56:12 -0800
On 11/2/01 7:19 AM, "Rob Stott" <email@hidden> wrote:
>
Hi, I've got a droplet (contents of the script below) that lets me drop
>
files onto it to send to specific email address. It works fine but for some
>
reason the message never gets stored in my 'Sent Messages' folder - can
>
anyone suggest a modification to this script which would solve this?
>
>
Thanks in advance,
>
Rob
>
>
---The Script Follows---
>
>
>
on open theFiles
>
set theAddress to "email@hidden"
>
try
>
tell application "Microsoft Entourage"
>
activate
>
set draftWindow to make new draft window with properties
>
{subject:"Proofs for your Approval", recipient:theAddress, content:"Blah
>
Blah Blah"}
>
repeat with theAttachment in theFiles
>
make attachment at draftWindow with data
>
{file:theAttachment} new attachment
>
end repeat
>
send draftWindow
>
end tell
>
on error
>
display dialog "The proof was not sent, something went wrong!"
>
buttons {"OK"} with icon note
>
end try
>
end open
Somewhat to my amazement, it works just fine here (after removing hard
carriage returns introduced by plain text email, of course), and is stored
in my Sent Items folder. I have never seen this this construction before:
make attachment at draftWindow with data {file:theAttachment} new
attachment
Where did you get that? The usual form is:
make attachment at draftWindow with properties {file:theAttachment}
I have never seen this 'new attachment' thing.
The only reason why it wouldn't be stored in your Sent Items folder is if
you have some Outgoing (or Mailing List) Rule which moves it to some other
folder, and it meets those criteria. Check over your Outgoing Rules and see
which it meets, and where it might be stored. Why don't you do an Advanced
Find for messages of the correct subject and recipient and find out where
these messages are being stored. Or do you already know? In any case, this
would not be an applescript issue, but an Entourage issue.
More on topic, are you aware that you don't need to have windows flashing up
on the screen? You can make an outgoing message, rather than a draft window.
Just change the draft window line to
set newMsg to make new draft window with properties {subject:"Proofs for
your Approval", recipient:theAddress, content:"BlahBlah Blah"}
and change the variable draftWindow to newMsg throughout of course (you
could keep it as draftWindow but it would be confusing). Since it doesn't
specify where the message is made, it's made by default at the Drafts
folder, as if I had written
set newMsg to make new draft window at drafts folder with properties
{subject:"Proofs for your Approval", recipient:theAddress, content:"BlahBlah
Blah"}
All the messages I've made with your script get stored in my Sent Items
folder. So you must have some rule that's sending them elsewhere.
--
Paul Berkowitz