Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Default account

1 view
Skip to first unread message

Francis Hookham

unread,
Oct 15, 2005, 5:37:22 AM10/15/05
to
New to Entourage and no knowledge of Apple Script

Can anyone write a script to toggle between one Entourage account and
another

With OS9 I could do this with Quickeys but I do not have OSX version and I
wonder if this is the sort of thing one coul do with Apple Script

Francis Hookham

Adam Bailey

unread,
Oct 15, 2005, 6:02:09 PM10/15/05
to
Francis Hookham <fh.2...@ntlworld.com> wrote:
> New to Entourage and no knowledge of Apple Script
>
> Can anyone write a script to toggle between one Entourage account and
> another

Can you be more specific about what it is you want to accomplish? What do
you mean by "toggle" between accounts?

--
Adam Bailey | Chicago, Illinois
ad...@lull.org | Finger/Web for PGP & S/MIME
ada...@aol.com | http://www.lull.org/adam

Paul Berkowitz

unread,
Oct 15, 2005, 8:13:55 PM10/15/05
to
On 10/15/05 3:02 PM, in article slrndl2v3...@millennium.akb.lull.org,
"Adam Bailey" <ad...@lull.org> wrote:

> Francis Hookham <fh.2...@ntlworld.com> wrote:
>> New to Entourage and no knowledge of Apple Script
>>
>> Can anyone write a script to toggle between one Entourage account and
>> another
>
> Can you be more specific about what it is you want to accomplish? What do
> you mean by "toggle" between accounts?

Do you actually mean "identity" a in Entourage/Switch Identities? (Note that
you can have as many email accounts as you want in one identity. Go to
Tools/Accounts/New.)

Or do you just want a keyboard shortcut to change the account _of a new
email message window_ without having to click the Account popup and choose
the account?

--
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.

Francis Hookham

unread,
Oct 16, 2005, 4:51:34 AM10/16/05
to
I have just got used to switching the account default via Quickeys to use a different eaddress for some mailings* and I wondered if this was an opportunity to see whether Apple Script could accomplish the same task -

Tools > Accounts > select an account> Make default > Close

(I use Ctrl/Alt/7 for this eaddress and Ctrl/Alt/9 to go back)

Although a Mac user since 128k I have never ventured into Apple Script

Many thanks

Francis Hookham

* I know it can be done from the account popup in the compose window (but not visible in PC OE9 MS News where I sometimes post to newsgroups
_____________________________________________________

Paul Berkowitz

unread,
Oct 16, 2005, 12:33:38 PM10/16/05
to
But there's no need to change the Default Account if all you want to do is change the actual account of the message you're sending. I.e., the manual way to do this is to File/New/Mail Message (or cmd-opt-N, or cmd-N), then flip the "From:" popup to the account you want. Simple.

And – yes – this can be done extremely simply from an AppleScript. It's easiest if you make your own, and hardcode in the names of your accounts. It's also essential to specify in the script whether  each account is a POP, IMAP, Hotmail, or Exchange account. You know that, but I don't, so just adjust the script below. Due to an ancient design of the Entourage script menu (so that it will still work in Jaguar), scripts made in Panther and Tiger Script Editor do not preserve changes to script properties, so we need to include a line that makes it figure out every time which account is your default account, And due to an Entourage bug, that will error in some versions if it's an Exchange account, so if you've got an Exchange account, let me know and I'll adjust it. I'm going to assume from your "toggle" phrasing that we're dealing with only two possible accounts here.


tell application "Microsoft Entourage"
    if class of window 1 ≠ draft window then
       beep
       return --quit
   end if
   set def to default mail account
   if def = POP account "Name 1" then
       set account of window 1 to POP account "Name 2"
    else
       set account of window 1 to POP account "Name 1"
    end if
end
tell


Put in the right names for your two accounts, and change POP to IMAP if appropriate, Ask me what to do if Exchange. When you run this script and want to change from whatever happens to be the default account to the other one, it will do it.

First go to Help and read up on "About the script menu" to choose a keyboard shortcut – and make sure you pick one not already taken by Entourage. using Control key (including in conjunction with Command key) is pretty safe – there aren't too many taken. For example, let's pick control-command-Z, which is easy to press with left hand, (ctrl-cmd-A scrolls the message to the top, so that's no good. Control-z is also fine, but you might press cmd-Z by mistake.) So

    Switch Account \cmZ

would be a name that would work (as would Switch Account \cZ ) . Copy and paste the script above into Script Editor. Click Compile, then File/Save and save it as a Script (the default) named Switch Account \cmZ or whatever, with or without the .scpt extension. Save it to the Entourage Script Menu Items folder in the Microsoft User Data folder in your user Documents folder.

Now you'll see the script name appear, with its keyboard shortcut suitably transmogrified into the usual symbols, in the Entourage script menu. When you have a new message window up, press the keyboard shortcut, and watch the "From" change. If you have any other type of window up (main window, received message, contact window, etc) and you press the key combo by accident, it will just beep at you.


--
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.



From: Francis Hookham <fh.2...@ntlworld.com>
Newsgroups: microsoft.public.mac.office.entourage
Date: Sun, 16 Oct 2005 09:51:34 +0100
Subject: Re: Default account
0 new messages