Re: Empty trash with locked items
Re: Empty trash with locked items
- Subject: Re: Empty trash with locked items
- From: Robert Rust <email@hidden>
- Date: Thu, 19 Jul 2001 19:00:55 -0500
>
Sorry for the basic question, but I'm having trouble navigating
>
www.apple.com/applescript. . .
>
>
How can I empty the trash when there exists locked items?
>
>
tell application "Finder"
>
empty trash (with command key down?)
>
end tell
>
I found this doesn't work well when there are a large number of files in the
Trash. In my case it was under MacOS 9.0.4 (and due to other AS issues I
can't upgrade), so I hacked the Finder to add a keyboard shortcut to the
'Empty Trash' command. I then used a scripting addition (Sandi's
Additions?) to script typing the keystroke with the option key modifier.
Since I have to wait until the trash is empty, my script checks the trash
every 3 seconds to see if it's empty until it is, then continues.
Robert