Script to make a global keyboard shortcut for trashing

Hello all,

Using Panther and g4 powerbook

I am trying to write a simple script that I can set up as a global keyboard shortcut to move specific files or folders to the trash. I would like to be able to just click on a file/folder on the desktop or otherwise, and then press say command T and have that file/folder moved to the trash.

This is easy for me to do if I write a script for a specific file or folder, example…

set trashExample to (choose file)
tell application “Finder”
move trashExample to trash
end tell

I am stuck on how to specify a file/folder being “active” or “selected” without actually specifying the file through choosing as in above. What is the terminology in applescript that relates to a file that has been clicked on once and thus highlighted?

I would appreciate any help here or, if someone knows a better way to do it then that would be great too!

This should work:

tell application "Finder" to delete selection

Jon

Of course, is having this assigned to a hot key really easier than just hitting command-delete (which moves the current selection to the trash anyway)?

Jon

Thanks for the help with this script! I apologize for my ignorance to the command-delete keystroke combination to achieve the same thing I am looking to do!

Anyway,

Thanks again!