Re: Rogue list?
Re: Rogue list?
- Subject: Re: Rogue list?
- From: Chris Espinosa <email@hidden>
- Date: Mon, 7 May 2001 11:18:11 -0700
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.
Chris