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

**URL:** https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976
**Category:** Automation
**Created:** [January 12, 2019, 4:47am UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976 "2019-01-12T04:47:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sarima](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@sarima](https://discourse.devontechnologies.com/u/sarima)
#### Post date: [January 12, 2019, 4:47am UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976/1 "2019-01-12T04:47:38Z")

</div>

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

```auto
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:

```auto

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

---

<div class="post-metadata">

### Author: ![Allsop](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/allsop/32/140_2.png) [@Allsop](https://discourse.devontechnologies.com/u/Allsop)
#### Post date: [January 12, 2019, 7:25am UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976/2 "2019-01-12T07:25:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)
#### Post date: [January 12, 2019, 1:57pm UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976/3 "2019-01-12T13:57:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![korm](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/k/e0b2c6/32.png) [@korm](https://discourse.devontechnologies.com/u/korm)
#### Post date: [January 12, 2019, 3:37pm UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976/4 "2019-01-12T15:37:03Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sarima](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@sarima](https://discourse.devontechnologies.com/u/sarima)
#### Post date: [January 12, 2019, 5:13pm UTC](https://discourse.devontechnologies.com/t/is-there-a-better-way-to-create-a-link-to-another-document/24976/5 "2019-01-12T17:13:49Z")

</div>

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.

🙂 Thanks!
