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

Re: list of aliases


  • Subject: Re: list of aliases
  • From: has <email@hidden>
  • Date: Wed, 27 Apr 2005 20:12:38 +0100

kai wrote:

> > Can someone tell me why this line of code:
>>
>> set theList to (every item of alias hold_folder whose kind is not
>> "folder") as alias list
>>
>> works if there are two or more files (non-folders) in hold_folder but
> > fails if there is a single file in hold_folder.
>
>The curious thing about this bug is that, according to Script Editor's
>event log, the initial coercion of a single item list appears to be
>successful.

What's even more curious is that the Finder actually evaluates commands like 'get every item of someFolder as alias' and 'get every item of someFolder as file specification' correctly, returning a list of zero or more alias/filespec objects as you'd expect. It's AppleScript that subsequently spoils everything by performing a second coercion on the returned value, which then fails as you'd expect when it's not a single-item list. Ironically, instead of fixing the problem at source (i.e. preventing AppleScript applying the duplicate coercion), the Finder tries to kludge around this first bug by introducing its own 'alias list' coercion and ends up introducing a second(!) bug instead. Go figure... :p

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: The Pyramid - a challenge...
  • Next by Date: Re: General questions from a non-Applescript coder.
  • Previous by thread: Re: list of aliases
  • Next by thread: Settings in Microsoft entourage
  • Index(es):
    • Date
    • Thread