Re: Files of folder returns 0 when count every folder returns correct number
Re: Files of folder returns 0 when count every folder returns correct number
- Subject: Re: Files of folder returns 0 when count every folder returns correct number
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 05 Feb 2002 23:51:02 -0800
On 2/5/02 11:10 PM, "Timothy Bates" <email@hidden> wrote:
>
When I have a folder with some files in it and
>
>
count every file of folder "amygdala:Pictures:needfixing:"
>
>
Correctly returns 156
>
>
Nevertheless a repeat loop dies on count 0
>
>
For instance
>
>
repeat with x in files of alias "amygdala:Pictures:needfixing:"
>
-->stops immediately
>
>
The event log shows that the count returns 0
>
>
repeat with x in files of folder "amygdala:Pictures:needfixing:" also dies
>
immediately.
>
>
Is this a 1.8.2b2 bug, an X bug, or am I missing something?
1) Parentheses.
2) Evaluation of application properties by setting to a variable or by the
explicit 'get'. (i explained this to you once, Tim, for Entourage. Exactly
the same applies to the Finder, and to many other apps);
So:
repeat with x in (get files of folder "amygdala:Pictures:needfixing:")
Now, a new thing. in OS X, if you're accessing any (formerly) string
property of the files:
3) the Finder insists on Unicode text, so:
repeat with x in (get files of folder "amygdala:Pictures:needfixing:")
display dialog (name of x as Unicode text)
or it won't work.
--
Paul Berkowitz