Hello Drafts community!
I happen to be a non-headings person. I just type something which could become a long sentence or even a paragraph. So first-line-as-title more often than not does not work for me.
In Drafts 4 I had a simple script (which in addition removed Markdown characters) that just worked fine for my purposes:
var maxLength = 50;
var firstLine = draft.content.split(‘\n’)[0];
var trimmedTitle = firstLine.replace(/[#*]/gi,“”).trim();
trimmedTitle = trimmedTitle.substr(0, maxLength);
draft.defineTag(“trimmedTitle”, trimmedTitle);
And in the URL action I set title=[[trimmedTitle]].
In Drafts 5 this does not work anymore. The last line of the script causes an error. I suspect the introduction of tags (hooray!) caused a change in the nomenclature. Or is there a better way of handing over variables to URL schemes?
A little PS: While I was just mentioning tags (hooray!)—why isn’t there a little tags bubble in the URL scheme?