Re: Entourage - send new mail
Re: Entourage - send new mail
- Subject: Re: Entourage - send new mail
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 28 Jun 2005 10:27:04 -0700
- Thread-topic: Entourage - send new mail
Title: Re: Entourage - send new mail
On 6/28/05 8:21 AM, "Ruby Madraswala" <email@hidden> wrote:
This is very basic, am having problems with the script below.
Microsoft entourage 2004. version 11.1.0
Set pwriteup to “Macintosh HD:FileToSend:v9999”
tell application "Microsoft Entourage"
activate
set newMessage to make new outgoing message with properties {subject:"translation", content:"" & return & return}
tell newMessage
set visible to true
make new to recipient at end of to recipients with properties {address: email@hidden}
tell content
make new attachment with properties {file name: "pwriteup"} at after the last paragraph
end tel
end tell
end tell
I get an error message at “@” expected , or } but found unknown token – line make new to recipient. And also error at make new attachment.
How do I send multiple attachments to multiple email addresses?
Where I can I find entourage script examples, I searched the net but did not find one for sending new mail. Also checked all my emails on subject email.
Whoa! I hardly know where to start. Are you aware that when writing AppleScripts for applications, you need to consult the application's Dictionary to see what properties and elements even exist ad are scriptable? It looks to me as if maybe you tried to make a script written for Apple Mail work for Entourage. That won't do. Fortunately Entourage is very scriptable, but you have to check its dictionary. For starters:
There is no 'visible' property of an outgoing message: it doesn't exist. Check the dictionary. It sounds to me as if maybe what you actually want here is to make a draft window - a new message window on the screen - not an encoded outgoing message in the Drafts folder or elsewhere, ready to send. Is that right? Then you'll need to make a new draft window, not a new outgoing message. (A small point: you won't actually have to specify content:"" - that's the default anyway. But that's not important.)
If you are in fact making a draft window, then the syntax for making to recipients – a string (Unicode text, to be precise) - is a lot simpler than making recipients of an outgoing message. And making recipients of an outgoing message hits an undocumented quirk in Entourage's dictionary – sorry – you have to use a pseudo 'recipient' property when making new outgoing message, since you can't make a new recipient of an encoded message after it exists. You can avoid all this with the draft window, but ask if you want to know more about this. Whichever method you use, the actual email address must be in quotes: it's a string. Similarly, you can use the undocumented 'attachment' property when making an outgoing message or draft window, if you wish – or else simply 'make new attachment at newMessage with properties {file:anAlias}'. In any case, you would never, ever tell the content – of all things – to make an attachment. 'content' is just a text property, it can't have elements like attachments, let alone 'at after the last paragraph'. Finally, 'attachment' does not have a 'file name' property, it has a 'file' property. And this 'file' property must be an alias reference, not a text string. Make sure the file actually exists when you run the script.
I think this is what you probably want:
set pwriteup to "Macintosh HD:FileToSend:v9999" as alias
tell application "Microsoft Entourage"
activate
set newMessage to make new draft window with properties {to recipients:"email@hidden", attachment:{file:pwriteup}}
end tell
If you didn't know about that undocumented pseudo-property 'attachment' and depended just on the dictionary, this would work equally well:
set pwriteup to "Macintosh HD:FileToSend:v9999" as alias
tell application "Microsoft Entourage"
activate
set newMessage to make new draft window with properties {to recipients:"email@hidden"}
make new attachment at newMessage with properties {file:pwriteup}
end tell
I'm not quite sure what you meant by "searching the web". The main repository for scripts is at
MacScripter.net <http://macscripter.net/scriptbuilders/>
You will find close to 200 scripts for Entourage there: there's an "Entourage" category section – look there. Stick with the simpler ones to begin with, and the scripts specified for OS X. (Shareware scripts will be run-only, so stick to the freeware scripts which are editable and can be opened in Script Editor.)
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden