Script for copying link with description both for files AND folders?

@chrillek Thanks for the input :slight_smile:

This here solved it:


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).

Taken from:
– open x-devonthink-item links in main window