# Constructing Item Link?

**URL:** <https://discourse.devontechnologies.com/t/constructing-item-link/12715>\
**Category:** Automation\
**Created:** [September 8, 2011, 8:22pm UTC](https://discourse.devontechnologies.com/t/constructing-item-link/12715 "2011-09-08T20:22:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tshanno](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@tshanno](https://discourse.devontechnologies.com/u/tshanno)\
**Post date:** [September 8, 2011, 8:22pm UTC](https://discourse.devontechnologies.com/t/constructing-item-link/12715/1 "2011-09-08T20:22:49Z")

</div>

Hi,

I’ve been trying to mimic the behaviour of “Copy Item Link”. I usually contruct an item link with this code:

```auto

repeat with theSelectedRecord in theSelection
	set theUUID to uuid of theSelectedRecord
end repeat

set theItemLink to "x-devonthink-item://" & theUUID

```

This works very well for rtf files and the like. But its a total fail for emails in DEVONthink on my system.

For instance, this code yeilds the following “Item Link” for one email on my system:

x-devonthink-item://[ffeb5ac2369121bc258e78163f6749c2@async.facebook.com](mailto:ffeb5ac2369121bc258e78163f6749c2@async.facebook.com)

The actual link to the email item as obtained by “Copy Item Link” is:

x-devonthink-item://%3Cffeb5ac2369121bc258e78163f6749c2@async.facebook.com%3E

Any suggestions for making my construction look like the actual link would be greatly appreciated.

Thanks,  
Tom

---

<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:** [September 8, 2011, 8:54pm UTC](https://discourse.devontechnologies.com/t/constructing-item-link/12715/2 "2011-09-08T20:54:28Z")

</div>

Could be simplied, but this does it for me. “Reference URL” was introduced a while back to eliminate the need for a do-it-yourself URL-making routine.

```auto
tell application id "com.devon-technologies.thinkpro2"
	set the clipboard to the (reference URL of the first item of (selection as list) as string)
end tell

```

---

<div class="post-metadata">

**Author:** ![tshanno](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@tshanno](https://discourse.devontechnologies.com/u/tshanno)\
**Post date:** [September 9, 2011, 2:51pm UTC](https://discourse.devontechnologies.com/t/constructing-item-link/12715/3 "2011-09-09T14:51:39Z")

</div>

That’s fantactic. Thanks for the quick response.

Tom

---

<div class="post-metadata">

**Author:** ![system](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/4/4e6ff70c96be2eb307a274d890bba8d71ba671b3.png) [@system](https://discourse.devontechnologies.com/u/system)\
**Post date:** [January 21, 2022, 11:13am UTC](https://discourse.devontechnologies.com/t/constructing-item-link/12715/4 "2022-01-21T11:13:38Z")

</div>

Closed on January 21, 2022, 11:13am UTC


