Re: Repeat Loop Skipping Items
Re: Repeat Loop Skipping Items
- Subject: Re: Repeat Loop Skipping Items
- From: Michelle Steiner <email@hidden>
- Date: Sat, 9 Jun 2001 06:25:38 -0700
On 6/9/01 4:04 AM, Nigel Garvey <email@hidden> wrote:
>
The expression 'every file of thisFolder' is not actually an AppleScript
>
list of the files, but a reference to the Finder's own list of them. As
>
you move files out of the folder, they cease to be members of 'every file
>
of thisFolder' and the Finder list is updated. If you remove, say, the
>
first file from the folder, the second file becomes the first, the third
>
file becomes the second, and so on. The AppleScript repeat loop, however,
>
continues to access consecutive *positions* in this list - so the second
>
time through, it misses the old second file (now in the first position)
>
and accesses what used to be the third. The more files you remove, the
>
more files get skipped.
>
>
The way round this is to...
Or to loop through the list backwards.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------