How do I use a keyboard shortcut to execute a shell script I wrote, passing the file selected in Finder as an arg? I suppose you could have it pass in whatever was selected in general in any app (such as text highlighted in a web browser).
Use Automator. Generate a .app. A keyboard shortcut can launch the app, and Automator knows how to grab the Finder selections, which it can then pass to the shell script.