Very rough notes to show the type of sytnax that needs to be supported to support user-defined replacement keys (with configurable joinMethod, case-sensitivity and percent-encoding) for the mailto: "open with other application" format string. http://mail.google.com/mail/?compose=1&view=cm&fs=1&to={"hname" : "to", "joinMethod" : "address", "ignoreCase" : "true", "percent-encoded" : "true"}&su={"hname" : "subject", "joinMethod" : "default", "ignoreCase" : "true", "percent-encoded" : "true"}&body={"hname" : "body", "joinMethod" : "multi-line", "ignoreCase" : "true", "percent-encoded" : "true"}&cc={"hname" : "cc", "joinMethod" : "address", "ignoreCase" : "true", "percent-encoded" : "true"}&bcc={"hname" : "bcc", "joinMethod" : "address", "ignoreCase" : "true", "percent-encoded" : "true"} {"uri" : "prefix"} is a replacement key object for the full mailto URI including "mailto:" {"uri" : "noprefix"} { starts a replacement key object } ends the replacement key object }} = } {{ = { {"hname" : "notfound"} will be replaced with "". User-entered syntax must be perfect and no unsupported variables can be specified. If so, an error should be indicated. (hnames in the mailto URI are percent-decoded first before comparing) " outside a replacement object is used for quoting the command line argument (which also then escapes \ and " (where needed) in the value returned by the replacement key object) so it doesn't end the quoted argument too early on the command line). User-entered, non-replacement-object text inside the quotes must be properly escaped by the user or an error will be emitted. Here's a quoting example: program: app.exe open with other application: "profile-dir=c:\document and settings\user\desktop\\" "quoted=\"test\"" "-subject={"hname" : "subject", "joinMethod" : "default", "ignoreCase" : "true", "percent-encoded" : "false"}" uri: mailto:?subject=%5C Would execute: "app.exe" "profile-dir=c:\documents and settings\user\desktop\\" "quoted=\"test\"" "subject=\\" and the app would get: profile-dir=c:\documents and settings\user\desktop\ quoted="test" subject=\ Join methods (searching is from left to right): address: Join all non-empty instances of the hvalue with "%2C%20" (or, ", " if percent-encoded is false.) default: Use only the last instance of the hvalue (even if the hvalue is empty) multi-line: Join the first non-empty instance of the hvalue and all instances after that (even if they're empty) with %0D%0A (or \r\n if percent-encoded is false (or platform-depending newline if necessary)) ignoreCase: if true and {"hname" : "body"}, body=line1&BoDy=line2 would emit "line1%0D%0Aline2". If false, it would only emit "line1". percent-encoded: If true, subject=1%202 would emit "1%202". If false, it would emit "1 2".