• 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: Rogue list?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rogue list?


  • Subject: Re: Rogue list?
  • From: Bill Cheeseman <email@hidden>
  • Date: Sat, 12 May 2001 11:44:40 -0400

on 5/12/01 10:18 AM, Paul Berkowitz at email@hidden wrote:

> WHY does the Finder return an empty record rather than an empty list when
> it's asked for a direct object including a plural?

Coming in late on this thread, so apologies if it's misdirected.

I have noticed a general lack of official guidance for developers on this
point, so it is not surprising that there is inconsistency among
applications (including the Finder). For the future, Apple could solve the
problem by publishing a specification of correct behavior.

My personal view is this: A property or command that returns a list when
there are multiple items should ALWAYS return a single-item list when there
is one item and an empty list when there are no items. This allows scripters
to use simple, straightforward loops without having to account for the
single-item case and without requiring a 'try/on error' test for the no-item
case. Scripters who need to handle the one-item and no-item cases would not
be impeded in doing so.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA

The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes


References: 
 >Re: Rogue list? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: CarbonLib 1.3.1
  • Next by Date: Re: Applescripting an export from Palm for FIleMaker
  • Previous by thread: Re: Rogue list?
  • Next by thread: Re: Rogue list?
  • Index(es):
    • Date
    • Thread