There are a couple of ways to go about this:
- Hack the Finder to add a keyboard command for emptying the Trash (I use “T”). After doing so, Command-T empties the Trash. Using the OSAXEN “Sandi’s Additions,” you can then write a script that simulates Command-Option-T (TypeText “t” with Command and Option) which empties the Trash of all items including locked items.
I believe that the Akua Sweets OSAXEN allows you to do the same without hacking the Finder but I personally find the Akua Sweets dictionary to be a little difficult. - The other way is to unlock all items before you toss them into the Trash or unlock all items that reside in the Trash (set locked of every item of the entire contents of trash to false). I found that unlocking all items in the Trash created sporadic and unreliable results, especially with items locked in sub-sub-folders, etc. What does work consistently is to put the items in a temporary folder, unlock all the items, move them to the Trash, and then delete the Trash.
Both methods work great. I’ll be more than happy to send you the scripts that I use/wrote.