# Create Hook URLs for a specific PDF page in DEVONthink

**URL:** https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332
**Category:** Share Hookmark automation
**Created:** [March 24, 2020, 6:46pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332 "2020-03-24T18:46:31Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![johnsidi](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/johnsidi/32/732_2.png) [@johnsidi](https://discourse.hookproductivity.com/u/johnsidi)
#### Post date: [March 24, 2020, 6:46pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/1 "2020-03-24T18:46:31Z")

</div>

DEVONthink can create URLs for a specific PDF page which look like the following:

> x-devonthink-item://7C28D0EE-7E51-4652-9690-6466694CE294?page=0

I customized the default Hook AppleScript in order to get links like the above as following:

```
tell application id "DNtp"
	if exists (content record of window 1) then
		-- current open item
		if type of (content record of window 1) is PDF document then
			set RecordLink to the reference URL of (content record of window 1)
			set PDFpage to current page of window 1
			set DEVONthinkLink to RecordLink & "?page=" & PDFpage
			return DEVONthinkLink
			
		else
			return reference URL of (content record of window 1)
		end if
	end if
	
	if class of window 1 is in {viewer window, search window} then
		set selected_items to selection of window 1
		if (count of selected_items) = 1 then
			if type of item 1 in selected_items is PDF document then
				
				-- current selected item
				set RecordLink to the reference URL of item 1 in selected_items
				set PDFpage to current page of viewer window 1
				set DEVONthinkLink to RecordLink & "?page=" & PDFpage
				return DEVONthinkLink
			else
				return reference URL of item 1 in selected_items
			end if
			
		end if
	end if
	
	-- selected group
	return reference URL of root of window 1
end tell

```

If I execute the script from the Script Editor it works fine. But when I activate the Copy Link command from Hook I get a URL without the “?page=0” part.

Any help is welcome!

---

<div class="post-metadata">

### Author: ![quorm](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/quorm/32/40_2.png) [@quorm](https://discourse.hookproductivity.com/u/quorm)
#### Post date: [March 24, 2020, 8:43pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/2 "2020-03-24T20:43:09Z")

</div>

Try adding an `activate`

This would be a very useful script if it works out.

---

<div class="post-metadata">

### Author: ![johnsidi](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/johnsidi/32/732_2.png) [@johnsidi](https://discourse.hookproductivity.com/u/johnsidi)
#### Post date: [March 25, 2020, 11:33am UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/3 "2020-03-25T11:33:30Z")

</div>

I was trying the script with DEVONthink 2. After installing DEVONthink 3 it works!

---

<div class="post-metadata">

### Author: ![quorm](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/quorm/32/40_2.png) [@quorm](https://discourse.hookproductivity.com/u/quorm)
#### Post date: [March 25, 2020, 11:57am UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/4 "2020-03-25T11:57:11Z")

</div>

Thanks – I can see using this on a page of a lengthy PDF to use Hook to link an extensive note to that page. Cool idea, I urge CogSci to incorporate your idea into the baseline set of scripts (@LucB)

---

<div class="post-metadata">

### Author: ![AlexVNYC](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@AlexVNYC](https://discourse.hookproductivity.com/u/AlexVNYC)
#### Post date: [December 7, 2020, 2:43pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/5 "2020-12-07T14:43:33Z")

</div>

Having specific hooks to specific pages of a long PDF would be particularly great in the enterprise and for attorneys and litigators. Courts gets hyperlinked courtesy copies of briefs and documents. That way the court can click on a cite and go directly to a page of an exhibits. When you put one Hook to a pdf it goes to the page where you put the hook. But if you put another hook on the same PDF both Hooks go to the last hook page for the you made. If Hook can fix it so you can put many hooks to the same PDF it would be a game changer.

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [December 7, 2020, 6:12pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/6 "2020-12-07T18:12:10Z")

</div>

> [@AlexVNYC](#):
>
> . If Hook can fix it so you can put many hooks to the same PDF it would be a game changer.

you’ll very soon be able to `Copy Link` to get to the specific page. That hook would need to be pasted in an associated documented however, as Hook only presents one link per target resource in the Hook window (with the exception being Pinned – i.e., a pinned bookmark can repeat something that is also contextually hooked).

---

<div class="post-metadata">

### Author: ![karkraeg](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/k/edb3f5/32.png) [@karkraeg](https://discourse.hookproductivity.com/u/karkraeg)
#### Post date: [March 15, 2021, 7:46pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/7 "2021-03-15T19:46:00Z")

</div>

So is this possible right now? The Script above does not quite work for me, where would I add an `activate`? Thanks!

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [March 15, 2021, 9:29pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/8 "2021-03-15T21:29:02Z")

</div>

Yes it is available. Please make sure you delete any overrides of the built-in PDFPenPro script in [Scripts Tab – Hook](https://hookproductivity.com/help/preferences/script-editor/).

Just select the PDFpenPro script there, and click on the `-` button. That way you will get the default integration. Please use Hook 2.2.2.

---

<div class="post-metadata">

### Author: ![karkraeg](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/k/edb3f5/32.png) [@karkraeg](https://discourse.hookproductivity.com/u/karkraeg)
#### Post date: [March 16, 2021, 6:36am UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/9 "2021-03-16T06:36:11Z")

</div>

Hi, PDFPenPro? I’m looking for DevonThink Pro Page Links 😉

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [March 16, 2021, 8:07pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/10 "2021-03-16T20:07:01Z")

</div>

ooops… same principle /page applies .

There is [Using Hook with DEVONthink by DEVONtechnologies – Hook](https://hookproductivity.com/help/integration/using-hook-with-devonthink/). And here is a page where we describe an alternative DEVONthink integration: [Customizing Hook Integration with DEVONthink – Hook](https://hookproductivity.com/help/integration/devonthink-custom-script/). Each page has an HTML link to the other.

---

<div class="post-metadata">

### Author: ![karkraeg](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/k/edb3f5/32.png) [@karkraeg](https://discourse.hookproductivity.com/u/karkraeg)
#### Post date: [March 16, 2021, 9:05pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/11 "2021-03-16T21:05:15Z")

</div>

But neither the default integration nor the Custom Integrations are able to link to specific pages of PDFs in DevonThink like [ohnsidi](https://discourse.hookproductivity.com/u/johnsidi) proposed?

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [March 16, 2021, 11:44pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/12 "2021-03-16T23:44:53Z")

</div>

> [@LucB](#):
>
> Yes it is available. Please make sure you delete any overrides of the built-in PDFPenPro script in [Scripts Tab – Hook](https://hookproductivity.com/help/preferences/script-editor/).

Sorry!!! I seem to have mixed topics (hence my mentioning PDFpenPro) [i switched too fast between customer support; other Hook tasks; and academic work.] Hook currently only supports deep links to PDFpenPro and Skim. PDFoo supports deep linking, but you’d need to use its `Copy Link` function. Not as robust or convenient as Hook’s deep links. If they add an API for deep linking we would likely support it. Deep-linking aside, PDFoo works fine with Hook. There’s also an alternative Hook script for [Curio](https://hookproductivity.com/help/integration/curio/). In Hook 2.3, Adobe Reader DC and Adobe Acrobat will get deep PDF linking too.

Now that we have the infrastructure in place, we’ll look at deep PDF linking for DEVONthink.

Please keep in mind that Hook’s deep PDF linking main use cases revolve around `Copy Link` and `Copy Markdown Link` , rather than hooking (bidirectionally linking). Hook will currently only show you one HOOKED entry per destination document. However, for each deep `Copy Link` or `Copy Markdown Link`, Hook will add a bookmark. You can find each bookmark with [Hook’s search tool](https://hookproductivity.com/help/preferences/script-editor/). Hook’s bookmarks may be renamed, for ease of processing.

We’re quite committed to deep PDF linking to support researchers, lawyers and all other deep PDF users. We also value DEVONthink integration.

---

<div class="post-metadata">

### Author: ![karkraeg](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/k/edb3f5/32.png) [@karkraeg](https://discourse.hookproductivity.com/u/karkraeg)
#### Post date: [March 17, 2021, 6:50am UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/13 "2021-03-17T06:50:45Z")

</div>

Thanks, and thanks for the explanation! Just one thing: What is `PDFoo` ?

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [March 17, 2021, 5:40pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/14 "2021-03-17T17:40:56Z")

</div>

It’s a PDF reader available on App Store: [‎PDFoo on the Mac App Store](https://apps.apple.com/us/app/pdfoo/id540272061?mt=12). The link to their website is broken.

It’s not that we’re recommending or endorsing the app, however. We simply provided integration based on user requests.

---

<div class="post-metadata">

### Author: ![echej](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@echej](https://discourse.hookproductivity.com/u/echej)
#### Post date: [February 16, 2022, 5:44pm UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/15 "2022-02-16T17:44:50Z")

</div>

Any chance that this is in the future near horizon?

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [February 17, 2022, 6:47am UTC](https://discourse.hookproductivity.com/t/create-hook-urls-for-a-specific-pdf-page-in-devonthink/1332/16 "2022-02-17T06:47:46Z")

</div>

Yes, this is on our list. We’re interleaving integrations with new software (3.4.2, 3.5 public beta, and an update to our iOS beta are all nearly ready).

DEVONtechnologies kindly provided some info we can use: [Deep Linking Hook - DEVONthink - DEVONtechnologies Community](https://discourse.devontechnologies.com/t/deep-linking-hook/69403/5)
