Create a devonthink URL with title but also title again before body/

Hi all

i am trying to adjust this URL i found online (i think by @RosemaryOrchard)

x-devonthink://createmarkdown?title=[[title]]&text=[[body]]

this works well, yet im trying to end up with the title not only in devonthink metadata but also as the first line of the .md file with a #

so something like this

# Title

BODY 

ie:

i tried adjusting the URL syntax with no success…but i clearly don’t know what im doing :slight_smile:

x-devonthink://createmarkdown?title=[[title]]&text=[[title]][[body]]

any tips?

thx!

Z

i think i managed to answer my own question…this seems to work…hope its proper syntax :slight_smile:

x-devonthink://createmarkdown?title=[[title]]&text=[[title]]%0A[[body]]

thx

z

You want the [[draft]] tag, which is the full text of the draft:

x-devonthink://createmarkdown?title=[[title]]&text=[[draft]]

Review this intro to using Drafts tags for more details.

thx @agiletortoise, that works well :smile:

z

is there a way to remove the "# " before the title like this replace[[title]], "# ", “”) ?

There could be titles that are non-firat level headings. The easiest way to deal with allvariations would be to use the inbuilt [[display_title]] template tag in place of [[title].

1 Like

wonderful, exactly what I needed, thanks a lot :grinning:

Just for sake of clarity, the final template for this action looks like this:

x-devonthink://createmarkdown?title=[[display_title]]&text=[[draft]]

This action will send the draft to DEVONthink in Markdown format, with the title displayed as the title (minus the heading hashtag), and the full text of the draft, including the title. It’s just what I needed!

1 Like