Re: Empty trash with locked items
Re: Empty trash with locked items
- Subject: Re: Empty trash with locked items
- From: Nigel Garvey <email@hidden>
- Date: Fri, 20 Jul 2001 23:09:06 +0100
Jon Pugh wrote on Fri, 20 Jul 2001 08:23:27 -0700:
>
At 3:09 PM +0100 7/20/2001, Nigel Garvey wrote:
>
>If you have Jon's Commands, you can do this:
>
>
>
> tell application "Finder"
>
> deleteFile (get items of trash) with unlocking without safety net
>
> update
>
> end tell
>
>
I think you'll need to get the files from the Finder as aliases. Using
>
object specifiers like this shouldn't work (I've actually tried to make it
>
work, but not successfully).
Well, it certainly works for me (in the form given above). :-) I've been
using a similar script to clear my RAM disk for a couple of years -
though I did in fact change it in January to work with aliases, along the
lines you suggest, which seems to get the job done more quickly. To flesh
out your script:
>
tell application "Finder"
try -- 'as alias list' doesn't work with just one item
>
set x to items of trash as alias list
on error
set x to items of trash as alias
end try
>
end tell
>
deleteFile x with unlocking without safety net
NG