Re: Emptying Trash with locked items
Re: Emptying Trash with locked items
- Subject: Re: Emptying Trash with locked items
- From: Nigel Garvey <email@hidden>
- Date: Thu, 18 Oct 2001 01:24:03 +0100
"Perbix, Michael" wrote on Wed, 17 Oct 2001 10:31:41 -0400:
>
So I figures that I can just write a little applescript that will check to
>
see if the folder IS there and if so, remove it to trash and empty the
>
trash....2 things I just can not get to work...
>
>
number 1 is checking to see if it is there...
>
number 2 is emptying the trash with locked items since the aliases are
>
locked.
>
>
I got the moving it to the trash part working fine and the empty the trash
>
piece (but not locked items)
If you have Jon's Commands installed:
tell application "Finder"
try
(contents of trash) as alias list
on error
(contents of trash) as alias
end try
end tell
-- Requires Jon's Commands
deleteFile the result with unlocking without safety net
However, with 'deleteFile' (the command from Jon's Commands), you can
just zap the folder on the spot without moving it to the trash:
tell application "Finder"
try
deleteFile folder "My Servers" of the apple menu items folder with
unlocking without safety net
on error
-- It didn't exist
end try
end tell
NG