Set default account via applescript

A

Andy Black

Hi,

I have a couple of applescripts that change around some of my network
settings and other stuff based on whether or not I am home or work. They
work fine except the part that sets my default account at work to my
Exchange account.

I can set my default account at home just fine (it's an IMAP) account.

Any ideas why I can't set the default account to an Exchange account via
applescript? The pertinent code snippet is below.

Thanks,

Andy

tell application "Microsoft Entourage"

set workAccount to Exchange account named "Work"
set homeAccount to IMAP account named "Home"

set default mail account to workAccount

tell homeAccount
set include in send and receive all to false
end tell

end tell
 
P

Paul Berkowitz

I have a couple of applescripts that change around some of my network
settings and other stuff based on whether or not I am home or work. They
work fine except the part that sets my default account at work to my
Exchange account.

I can set my default account at home just fine (it's an IMAP) account.

Any ideas why I can't set the default account to an Exchange account via
applescript? The pertinent code snippet is below.

It's a bug in Entourage 2004 (it works OK in X). You can neither set the
default mail account to an Exchange account, nor even _get_ the default mail
account if it's been set to an Exchange account in the User Interface (you
get an error). When they changed Exchange accounts in 2004 to the WebDAV
protocol (it was just an IMAP account back in 10.1.4), Exchange accounts
lost a lot of AppleScript features. Plus gained this bug. I imagine it will
get fixed at some point. Send in a bug report via Help/Send Feedback to help
make sure.
tell application "Microsoft Entourage"

set workAccount to Exchange account named "Work"
set homeAccount to IMAP account named "Home"

set default mail account to workAccount

tell homeAccount
set include in send and receive all to false
end tell

end tell


--
Paul Berkowitz
MVP MacOffice
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 Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top