On 2/9/01 10:26 AM, "G Wood" <[EMAIL PROTECTED]> wrote:
> On 2/9/01 1:07 PM, Paul Berkowitz <[EMAIL PROTECTED]> wrote :
>
>> Otherwise, it's a fine script.
>
> Any idea why the error dialog appears, then?
>
Is this not clear to you?:
> the variable 'replyAcct' is a POP account class, and not a string, which
> is what display dialog needs. Now you have already correctly set the replyAcct
> property to the right POP account, so that's why the script works on
> subsequent runs. The error is just here in the set-up part of the script,
> after you've correctly set the account. What you want is this:
>
> display dialog "I have registered \"" & (name of replyAcct) & "\" as the
> acct to use when this script is invoked." buttons {"OK"} default button "OK"
> with icon 1
> You just need to change
>
> replyAcct
>
> to
>
> (name of replyAcct)
>
> in the set-up dialog above
display dialog needs the NAME of the account. it needs a string (text).
It can't cope with an object of POP account class it needs TEXT, You gave
it
replyAcct
which is
POP account id 33
(As I said earlier, POP account "Some Name" is just a way of referring to
POP account id 33, which is how AppleScript will know and remember the
replyAcct property.)
That can't appear in the text of a display dialog. you have to put the NAME
of the account in the dialog text, not the account itself.
So it was the dialog that errored, not your setting the replyAcct property.
That's why you got an error, and why the script stopped before completion on
set up.
But in the meantime, the replyAcct property had already been correctly set
and remembered. So the next time you ran the script, when it doesn't have to
access the part of the script with the error, since replyAcct is now not "",
but 'POP account id 33', it just passes around the part of the script with
the faulty dialog. It moves on instead to the part of the script telling it
to set the front window's account to replyAcct, which is POP account 33,
does it, and everything is fine.
The only error is in the dialog on set-up where you tried to put a POP
account class into the middle of text.
Is this any clearer?
--
Paul Berkowitz
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>