Re: Emptying Trash with locked items
Re: Emptying Trash with locked items
- Subject: Re: Emptying Trash with locked items
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 17 Oct 2001 10:46:27 -0700
On 10/17/01 10:16 AM, "Cornwall" <email@hidden> wrote:
>
At 7:59 AM -0700 10/17/01, Michelle Steiner wrote:
>
>
>> number 2 is emptying the trash with locked items since the aliases are
>
>> locked.
>
>
>
> tell application "Finder"
>
> set the locked of the entire contents of the trash to false
>
> end tell
>
>
About a year ago I tested this construction and found that it failed with
>
sufficiently nested sub folders. It will skip some nested folders entirely. I
>
just re-tested this script with a six deep folder hierarchy, and got the same
>
result. Entire contents fails to find all the locked files. New G4 running OS
>
9.2.1.
>
>
tell application "Finder"
>
set the locked of (every file of the entire contents of the trash whose
>
locked is true) to false
>
end tell
>
It's a very well-known bug, perhaps the most notorious one in all
AppleScript. (Michelle seems very attached to 'entire contents', and
continually recommends it without ever mentioning this bug, forcing me to
add this correction every single time. ;-) This must be about the 10th
time.)
Just avoid 'entire contents' unless you deal only with small folders with
not much in them, which is usually not the case when people are looking for
this feature.) Use Akua Sweets' 'the entries in [someFolder] as alias to a
depth of -1' to get a reliable version (pre OS X, where Akua doesn't
operate).
--
Paul Berkowitz