Does any of you have a script for copying an item link with the description formated as a markdown link? Usually I copy the link via Ctrl + Opt + Cmd + C, paste it in my markdown document, go back to DEVONthink, copy the group name (aka folder name) and construct the link like so:
Change this set the clipboard to "[" & the name of the content record & "]
to something like set the clipboard to "[" & the name of the parent of the content record & "]
maybe? I did not try this, though.
tell application id "DNtp"
try
if not (exists think window 1) then error "No window is open."
-- if not (exists content record) then error "Please open a document."
set theItem to (item 1 of (selection as list))
set itemURL to get the reference URL of theItem & "?reveal=1"
set itemName to get the name of theItem
-- set the clipboard to itemURL
set the clipboard to "[[" & itemURL & "][" & itemName & "]]"
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
Edit: I have created a link for an org-mode document (slightly differes from markdown links).
This script Markdown version of the Item link can be used to copy one ore more links. Copying several links in one go is handy if you want to paste e.g. in iThoughts.