• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bug or feature?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug or feature?


  • Subject: Re: bug or feature?
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 24 Dec 2001 11:45:30 -0800

On 12/24/01 11:23 AM, "Deivy Petrescu" <email@hidden> wrote:

> I've noticed, in OS X, that choose from list returns "false",the AS
> constant not the string, if you press "Cancel".
> The dictionary says that choose from list should return a list of
> plain text, and "Cancel" should throw an error number -128.
> I am wrong not to trap a "Cancel" button with a if false statement ?

Where do you see it says "Cancel" should throw an error number -128, Deivy?
That's what display dialog does, not choose from list. (Very inconsistent,
yes. I think it's derived from the history that these were once separate
scripting additions, 'choose from list' being a 3rd-party, GTQ osax.)

'choose from list' has always returned false if canceled.

What the Dictionary in AS 1.8 in OS 10.1.2 says is:

choose from list list of string -- a list of strings to display (an
empty list if no selection)

Result: list of string -- the list of strings chosen


It doesn't say anything about error number -128. of course, it doesn't say
anything about 'false', either.

It might be nice if it actually canceled with an error number -128, as the
user expects, IF the button says "Cancel" on it, perhaps. But since you can
actually change the name of that button to say other things, you need to
have 'false' as a way of keeping the script going to do other things if the
user pushes that button when it says, perhaps "Help".

So, yes, you need to trap for false.

--
Paul Berkowitz


  • Follow-Ups:
    • Re: bug or feature?
      • From: Steven Angier <email@hidden>
References: 
 >bug or feature? (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: RE: bug or feature?
  • Next by Date: Definitely a bug
  • Previous by thread: bug or feature?
  • Next by thread: Re: bug or feature?
  • Index(es):
    • Date
    • Thread