"open -a /Applications/TextEdit.app '/Volumes/Macintosh HD/foo.txt'"
opens the document in the application specified (in this case, TextEdit)
That is exactly what the example does. The only thing that may be slightly surprising is what Mail.app does when you drag a .pdf on it. But that is only slightly surprising; the only alternative I can think of is that it would beep and do nothing else.
Also, the man page has several IMO more interesting examples than this "make a new mail from the command line, but you will have to use the GUI to fill in the destination address and to click 'Send'".
For example, I did not know about "open -f", "open -n -W", and "open -h".
Actually, the there is a reason why I use the short form - the rest of the workflow is also completely keyboard based:
`open -a Mail mypdf.pdf` opens an email window that has the focus and the cursor in the "from" field, with address book access and all. From there on, it is:
- Type the first letters of the contact to sent to
- Tab to "Subject", write Subject
- Tab to Body, write the Body
- Command-Shift-D
Includes all (legally needed, yawn...) signatures, my S/Mime-setup and has full access to my address book. Sure, its simple and the equivalent of dragging the pdf to the Mail icon, but damn quick.