Markdown version of the Item link

Not built-in but there’s AppleScript …

-- Copy record link(s) as markdown link(s)

tell application id "DNtp"
	try
		set windowClass to class of window 1
		if {viewer window, search window} contains windowClass then
			set currentRecord_s to selection of window 1
		else if windowClass = document window then
			set currentRecord_s to content record of window 1 as list
		end if
		
		if currentRecord_s = {} then
				display notification "Nichts ausgewählt!" with title "DEVONthink"
				return			
		end if
		
		if (count of currentRecord_s) = 1 then
			
			set theRecord to item 1 of currentRecord_s
			set theMarkdownLink to "[" & (name of theRecord) & "](" & (reference URL of theRecord) & ")"
			set the clipboard to theMarkdownLink
			display notification theMarkdownLink with title "Markdown-Link kopiert"
			
		else
			
			set theMarkdownLinksString to ""
			set theCount to 0
			
			repeat with thisRecord in currentRecord_s
				set thisMarkdownLink to "[" & (name of thisRecord) & "](" & (reference URL of thisRecord) & ")"
				set theCount to theCount + 1
				if theCount ≠ (count of currentRecord_s) then
					set theMarkdownLinksString to theMarkdownLinksString & thisMarkdownLink & return
				else
					set theMarkdownLinksString to theMarkdownLinksString & thisMarkdownLink
				end if
			end repeat
			
			set the clipboard to theMarkdownLinksString
			display notification theMarkdownLinksString with title "Markdown-Links kopiert"
			
		end if
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
end tell
1 Like