Is there a better way to create a link to another document?

Currently I’m having applescript open the window for the record and then

tell application "System Events" to tell process "DEVONthink Pro Office" to click (menu item 1 where its name starts with "Copy Page Link") of menu 1 of menu bar item "Edit" of menu bar 1

then later, have the applescript open a second document and:


tell application "System Events" to tell process "DEVONthink Pro Office" to click (menu item 1 where its name starts with "Paste") of menu 1 of menu bar item "Edit" of menu bar 1

I’m guessing there is a better way? Or, another way to ask is how can I generate a clickable link for a Formatted Note or rtfd? I can get the ‘reference URL’ of the record and insert that, but I don’t know how to make it into a link .

Thanks

Edit>Copy Item Link and then Edit>Paste Item Link

Inserting a link into a format like those is not a simple matter. There is underlying code that controls the recognition and display of the text in formats like RTF and HTML formats.
Have you tried Option-Command-dragging and dropping a file into the RTF file?

PS: Getting the reference URL is the correct thing to do. It’s what you get in the Copy item Link menu command.

If you have DEVONthink > Preferences > Editing > WikiLinks > Automatic active, then you can enter the name of another document in the same database into an RTF(D) or plain text file, and DEVONthink will create a link to that document. Does not work in markdown or formatted notes.

1 Like

Thank you for all the replies! Ah @korm, there was part of my confusion re: wiki style links not working in formatted notes. That’s great it works. It’s not exactly ideal, but I want to be able to edit some of the text on iOS occasionally, so I scripted a round trip of the note through “convert record xx to rich … convert record xx to note” and the link text gets properly linked.

:slight_smile: Thanks!