Script for creating markdown link

Would anyone perhaps have a script for creating a Markdown link to the currently selected DevonThink item? I’m thinking of something like this:

[Name of the selected item](x-devonthink-item://...)

Something like Ctrl-Alt-Cmd (Edit > Copy Item Link) on steroids, that is…

My AppleScript chops are too limited, as is my time at the moment… Many thanks.

My apologies for not crediting the author of this script as it is not me.

tell application id "DNtp"
	set the clipboard to "[" & the name of the content record & "](" & the reference URL of the content record & ")"
end tell

(* In Highlights, in the righthand pane, click "Edit" to see the Markdown text of your annotations and notes. Paste the clipboard (⌘V) where shown here -- replacing 
[Link](http://example.com) *)

1 Like

Fantastic. Many thanks to you, Greg, and to the anonymous author.

You’re welcome.

I should have guessed, korm. :slight_smile: Thanks as ever.