I often use thumb drives or external hard drives for transferring data from one computer to another – especially at work when I need to give a client many drawings and documents, or giving a friend a bunch of photographs from an event. Who doesn’t?
Note: when I refer to Disk, Drive or Volume – they all mean the same thing, and apply to thumb-drives, memory cards, external hard drives etc.
Some Mac OSX Trash 101 basics
When transferred I want to remove the files from the thumb drive / external hard drive to clean it up. Most (experienced) Mac OSX users will know that when you delete the files on an external drive it places them in a trash folder on the disk itself, and that this trash remains, getting bigger and bigger, taking up space on your external drive until you empty it.
If you empty your trash on your Mac without this hard drive connected – it doesn’t empty the trash on the external drive. Plug it in again and it’s still there.
If you empty your trash on you Mac with any external drive attached, it will empty the trash on all attached volumes/drives/disks.
But I want to only empty the trash on my external drive without touching my Mac’s hard drive trash
I like my trash, at least for a short period of time. It’s that just-in-case thing in addition to my TimeMachine backup. I certainly empty it regularly (a good habit), but I don’t want to have to empty it every time I eject a temporary thumb drive.

There are some pains third party applications for managing such things, but I was given this simple solution that does exactly what I want it to. I sourced this answer when asking the question on the Apple Discussion board, many thanks to Jacques Rioux.
It involves creating a simple script, using your built- in “AppleScript Editor” (look in Utilities). Just create a new file, and copy and paste the following code into it. Then Save As an “Application”.

To use, simply drag your Volume/Drive onto the icon or alias of this application you’ve just created.
So here is the code for two different options, where the second one ejects the disk as well as emptying its trash.
Note these scripts remove the items from your trash (your user ID) folder on the volume. If other users use the volume this script will not delete the items from their trash folder, otherwise the script would need an administrator password to do that.
Empty Trash on a Specific disk/drive
on open these_volumes
set t_id to user ID of (system info)
repeat with i in these_volumes
if (kind of (info for i without size)) is "Volume" then
set tPath to (POSIX path of i) & ".Trashes/" & t_id
do shell script "/bin/rm -Rf " & (quoted form of tPath) & "/*"
end if
end repeat
end open
Empty Trash on Specific Disk/Drive, then Eject it
on open these_volumes
set t_id to user ID of (system info)
set volToEject to {}
repeat with i in these_volumes
if (kind of (info for i without size)) is "Volume" then
set tPath to (POSIX path of i) & ".Trashes/" & t_id
do shell script "/bin/rm -Rf " & (quoted form of tPath) & "/*"
set end of volToEject to contents of i
end if
end repeat
if volToEject is not {} then tell application "Finder" to eject volToEject
end open