Re: Rogue list?
Re: Rogue list?
- Subject: Re: Rogue list?
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 08 May 2001 20:59:46 -0700
On 5/7/01 11:18 AM, "Chris Espinosa" <email@hidden> wrote:
>
> I'm running AS1.6 under 9.1. When I run the following:
>
>
>
> tell application "Finder"
>
> set myPath to path to me
>
> set myFolder to container of myPath
>
> set theClients to name of folders of myFolder
>
> end tell
>
> log class of theClients
>
> --if theClients = {} then set theClients to {}
>
> set end of theClients to "New"
>
> theClients
>
>
>
> I get an error that I "Can't set end of {} to "New"." But when I
>
> uncomment
>
> the line before, it works. Any explanations?
>
>
Yes, a simple one.
>
>
When the Finder returns an empty value collective Get Data operation
>
(anything with a plural anywhere in the direct object, such as your
>
"name of folders of myFolder"), it doesn't return an empty list, it
>
returns an empty *record*. Which looks and prints and smells like an
>
empty list, and compares correctly to an empty list, but can't do
>
list-like things, like having its end set. Your commented-out line is
>
unfortunately the correct workaround, as there's no way to specify an
>
empty record in AppleScript itself.
Why does it work in OS X without problem?
And why does it log the class as list instead of record in OS 9?
--
Paul Berkowitz