Thanks deanishe and everyone else for your help with this, and especially to deanishe for the mailto Workflow that is at its heart. I have it working now (Aflred and Keyboard Maestro links at the end of this post). I did change line 241 of mailto.py, per your suggestion, but it was still passing "compose" to the clipboard. That turned out not to be a problem, as the regex in my Keyboard Maestro macro still found only the numeric digits (as an aside, I imagine I could probably do this whole thing in Alfred, but I had the regex working in Keyboard Maestro and had no idea how to do that in Alfred). To answer one of the questions, above, I did want to pass the text to the clipboard, as my Keyboard Maestro macro acts on the text on the system clipboard. So I needed to find a way to get the text to the clipboard, and run my KM macro.
Anyway, thanks again for the help. The links are below. They won't be directly relevant to anyone who doesn't use my firm's case management system, but maybe they'll be indirectly helpful to others.
Alfred workflow: http://d.pr/f/PgRbBv
Keyboard Maestro macro: http://d.pr/f/a5k3K0