Re: empty trash with locked files
Re: empty trash with locked files
- Subject: Re: empty trash with locked files
- From: Rob Jorgensen <email@hidden>
- Date: Mon, 17 Sep 2001 19:14:38 -0400
On 09/17/2001, Mike Egglestone commented:
Hi,
I was wondering if there is a way to write a script that
would empty the trash even though locked files are in it.
<snip>
Or is there a way to unlock all files in the trash first,
but be able to unlock files in more than one folder?
I don't recall where it came from, but this appears to work:
-- Begin Code --
tell application "Finder" to set countTrash to (count of items of trash)
if countTrash is 0 then
return
else
tell application "Finder"
set locked of every file of entire contents of trash whose locked is
true to false
empty
end tell
end if
-- End Code --
Later,
Rob Jorgensen
Ohio, USA