There are many custom protocols where a command can be an URI.
For example ical://some_new_event
or mailto:john@malkovich.com
or magnet://
There are system wide associations in OS X, but there's no interface that can edit them. Only some applications can do that, but then the control is not in your hands. Here's how:
Download RCDefaultApp - this is a preference pane for System Preferences:
The last one, when opened, looks like this:
Change and save!