Entourage will not allow you to use AppleScript to set Exchange as the
default mail account. For example, neither of these scripts will work:
set default mail account to Exchange account "My Exchange"
or
-- won't work if default account is an Exchange account
set defAcct to default mail account
Have any AppleScript gurus run into this? Any work-around?
I guess it's because an Exchange account isn't really a mail account. But in
the UI of course you _can_ set your default to be an Exchange account.
BUG.
You get the credit for discovering it.
It's not unusual that adding new features introduces new bugs,
unfortunately. There's no workaround for the specific command. But there are
possibly workarounds for doing whatever it is you want to do with the
default account instead with a non-default Exchange account. And I suppose
you could make a logical deduction if
try
set defAccount to get default mail account
on error
set c to count (every Exchange account)
--check if there's just one Exchange account: that must be the one
if c = 1 then
set defAccount to Exchange account 1
else -- hack
set dummy to make new outgoing message at out box folder -- so you
don't need to check several drafts folders
set defAccount to account of dummy
delete dummy
try
delete dummy
end try
end try
--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Entourage you are using - **2004**, X
or 2001. It's often impossible to answer your questions otherwise.