Title: Re: More on new mail messages to specific accounts
Kirk -

On 12/19/02 10:05, Kirk McElhearn wrote:

> Re my request earlier today, Gary replied off-list with a couple of
> AppleScript solutions, but, looking at them, they're much more complicated
> than what I need.
>
> I don't know much about AppleScript, but it seems that it should be possible
> to do something like this:
>
> Tell application "Entourage"
> Activate
> Create new message with account "X"
> End tell

Almost – try:

    make new draft window with properties{account:POP account “acctname”}

Or ‘IMAP account’, or ‘Hotmail account’, as appropriate.

> I looked in the dictionary, but couldn't figure out how to do it, and the
> Script Editor doesn't record Entourage.
>
> Is the above possible?
>
> To go a bit further, what I would like is a script that shows me a dialog
> with a list of my accounts letting me double-click the one I want to use.
> Would that be possible?

And this should do that (I think; I have all three types of accounts, so can’t test the case where one or more types is missing).

global acctlist
set acctlist to {}

tell application "Microsoft Entourage"
    set poplist to {}
    try
       set poplist to name of every POP account
       set acctlist to poplist
   end try
   set imaplist to {}
    try
       set imaplist to name of every IMAP account
   end try
   my addtolist(imaplist)
    set hotlist to {}
    try
       set hotlist to name of every Hotmail account
   end try
   my addtolist(hotlist)
end tell

set choice to choose from list acctlist with prompt "Select sending account"

if choice is not false then
   set choice to item 1 of choice
   tell application "Microsoft Entourage"
        if choice is in poplist then
           set acct to POP account choice
       else if choice is in imaplist then
           set acct to IMAP account choice
       else
           set acct to Hotmail account choice
       end if
       make new draft window with properties {account:acct}
    end tell
end
if

on addtolist(more)
    if more is not {} then
       if acctlist is {} then
           set acclist to more
       else
           set acctlist to acctlist & more
       end if
   end if
end
addtolist


George

--
George Clark - [EMAIL PROTECTED]

Reply via email to