I’m working on an Alfred workflow for adding entries to a note, with a link previously stored in the clipboard. (It’s part of a project for implementing Daily Log routines in the Agenda).
It works when the URL doesn’t contain any parameters but breaks because ?s and &s are not correctly treated.
This is how I am preparing the text to pass to the callback-url:
I also tried substituting just those characters (sed -e 's/&/%26/g; s/\?/%3F/g' instead of the url encode via python), but the following doesn’t work either:
open "agenda://x-callback-url/append-to-note?title=13 Jul | Sáb&text=- [ ] [test again](airmail://message%3Fmail=xxxx%40gmail.com%26messageid=Apd.23965.51558.77863976.1563033585.365788.6ex%40a2plmmsworker08.prod.iad2.gdg.mail)"
You definitely have to escape your URL, for example spaces should be converted to %20 etc. Accented characters are officially also not part of the URL spec.
The ampersands that separate parameters should not be encoded of course, but all values for those parameters should be.