# PDF Expert integration scripts

**URL:** https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457
**Category:** Share Hookmark automation
**Created:** [May 12, 2019, 9:41pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457 "2019-05-12T21:41:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![stevelw](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@stevelw](https://discourse.hookproductivity.com/u/stevelw)
#### Post date: [May 12, 2019, 9:41pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/1 "2019-05-12T21:41:56Z")

</div>

I’ve seen some interest in PDF Expert integration. Here’s my script to integrate — ideally PDF Expert would add AppleScript support.

I don’t use PDF Expert myself and haven’t done much testing, so do let me know if this does what you want.

# Get Name

```auto
tell application "System Events"
	get name of first window of process "PDF Expert"
end tell

```

# Get Address

```auto
tell application "System Events"
	tell process "PDF Expert"
		if enabled of menu item "Show in Finder" of menu 1 of menu bar item "File" of menu bar 1 then
			click menu item "Show in Finder" of menu 1 of menu bar item "File" of menu bar 1
			delay 0.1
			tell application "Finder"
				set theItems to selection
				set ext to name extension of item 1 of theItems
				if ext = "hook" or ext = "HOOK" then
					set filepath to item 1 of theItems as alias
					return read POSIX path of filepath
				end if
				set theURL to URL of item 1 of theItems
				close front window
				activate application "PDF Expert"
				get theURL
			end tell
		end if
	end tell
end tell

```

---

<div class="post-metadata">

### Author: ![epetrack](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@epetrack](https://discourse.hookproductivity.com/u/epetrack)
#### Post date: [May 13, 2019, 2:03pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/2 "2019-05-13T14:03:29Z")

</div>

This is awesome- works great- thanks so much!

---

<div class="post-metadata">

### Author: ![John](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@John](https://discourse.hookproductivity.com/u/John)
#### Post date: [May 19, 2019, 6:19pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/3 "2019-05-19T18:19:51Z")

</div>

Just tried this, works perfectly and so easy to implement. Really enjoying Hook and exploring the ways in which it can enhance my work.

---

<div class="post-metadata">

### Author: ![countdrachma](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/c/d26b3c/32.png) [@countdrachma](https://discourse.hookproductivity.com/u/countdrachma)
#### Post date: [June 2, 2019, 12:54am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/4 "2019-06-02T00:54:13Z")

</div>

Hi guys. Complete newbie here. I had a quick read of the Integrations instructions but I’m clearly missing a key point. I’m unsure as to where / how you are supposed to actually save these script files to invoke them in Hook. This PDF Expert one is bang on for what I need so thanks @stevelw for creating this.

Would you have the patience in explaining how / where I have to save the script(s)? Thanks in advance for your help.

---

<div class="post-metadata">

### Author: ![stevelw](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@stevelw](https://discourse.hookproductivity.com/u/stevelw)
#### Post date: [June 2, 2019, 6:27am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/5 "2019-06-02T06:27:53Z")

</div>

The instructions for editing Hook scripts are [here](https://hookproductivity.com/help/preferences/script-editor#SEpanel). Let me know if you’re still lost.

---

<div class="post-metadata">

### Author: ![countdrachma](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/c/d26b3c/32.png) [@countdrachma](https://discourse.hookproductivity.com/u/countdrachma)
#### Post date: [June 2, 2019, 6:37am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/6 "2019-06-02T06:37:39Z")

</div>

> [@stevelw](#):
>
> tell application “System Events” tell process “PDF Expert” if enabled of menu item “Show in Finder” of menu 1 of menu bar item “File” of menu bar 1 then click menu item “Show in Finder” of menu 1 of menu bar item “File” of menu bar 1 delay 0.1 tell application “Finder” set theItems to selection set ext to name extension of item 1 of theItems if ext = “hook” or ext = “HOOK” then set filepath to item 1 of theItems as alias return read POSIX path of filepath end if set theURL to URL of item 1 of theItems close front window activate application “PDF Expert” get theURL end tell end if end tell end tell

No. I figured it out. Thanks Steve. Works great. Much appreciated.

---

<div class="post-metadata">

### Author: ![JLS](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@JLS](https://discourse.hookproductivity.com/u/JLS)
#### Post date: [December 20, 2019, 5:57am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/7 "2019-12-20T05:57:42Z")

</div>

I am trying to use PDF Expert with Hook and used the script suggested by stevelw to do so. The script works in a fashion, but it only links files to PDF Expert the application, not to any target file within PDF Expert. So, if I try to link a Word file to a PDF Expert file, all I get is a link to whatever file happens to be currently open in PDF Expert. Thus, if I create a link to a file open in PDF Expert but then close that file and open another file, the latter is what my Word file will then be linked to. I am hoping the script can be modified to accomplish what I want, but I don’t know how to do it.

---

<div class="post-metadata">

### Author: ![JLS](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@JLS](https://discourse.hookproductivity.com/u/JLS)
#### Post date: [December 21, 2019, 5:44pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/8 "2019-12-21T17:44:20Z")

</div>

I must have made some error when I originally entered the script, because now the script suggested by stevelw links, as intended, to individual PDF Expert files.

---

<div class="post-metadata">

### Author: ![NickSloan](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@NickSloan](https://discourse.hookproductivity.com/u/NickSloan)
#### Post date: [March 31, 2020, 12:54pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/9 "2020-03-31T12:54:40Z")

</div>

Are the PDF Expert scripts still working with PDFE 2.5.3 and Mojave? I believe that I have installed them correctly, but I am still getting “No linkable item found” when I invoke Hook.  
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: [April 5, 2020, 11:55pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/10 "2020-04-05T23:55:06Z")

</div>

as part of the Get Address script, @stevelw wrote:

> [@stevelw](#):
>
> delay 0.1

If you were to try increasing this number, the result might be better. Hook \> Preferences \> Scripts .

PDF Expert currently lacks AppleScript. (I was in touch with them again this week. Hopefully we will see some progress there.)

---

<div class="post-metadata">

### Author: ![NickSloan](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@NickSloan](https://discourse.hookproductivity.com/u/NickSloan)
#### Post date: [April 6, 2020, 9:13am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/11 "2020-04-06T09:13:52Z")

</div>

Thanks Luc. Tried increasing delay to 0.5 with no effect. BUT, I have discovered some strange behaviour that may have a bearing.

I use Path Finder (7) instead of Finder. I have tried applying both the script above and the one in the PDF Expert & Notability thread in the Get Address window. Currently I am using the one on this page, unchanged except for “delay 0.5”.

When I open a document in PDF Expert and invoke Hook, focus switches to Path Finder and the file for the document I am looking at is revealed in its PF window. It is as if I had cut straight to “Show in [Path] Finder”.

Curiously, if I change “Finder” in the script to “Path Finder”, focus stays with PDFE on invoking Hook, and just a blank Hook window opens (no linkable items). Then if I replace the Get Address script with the version in the Notability thread, the effect of invoking Hook is to _close all open Path Finder windows_! Clearly these scripts are not working as intended on my system, but this is probably due to the interaction with Path Finder. (I am also using dual monitors, but I don’t believe this is affecting things.)

---

<div class="post-metadata">

### Author: ![chazzo](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/chazzo/32/828_2.png) [@chazzo](https://discourse.hookproductivity.com/u/chazzo)
#### Post date: [May 1, 2020, 7:46pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/12 "2020-05-01T19:46:12Z")

</div>

@NickSloan I’m using Path Finder (9.2) and the original script from @stevelw works well for me after changing “Finder” to “Path Finder”. However, there’s one “gotcha”: I need to click on the page area of the PDF before invoking Hook. If I don’t do that, I get a blank Hook window, as you found.

I’m still trying to find out exactly which conditions cause the script to fail. If I use a keyboard command to move to a new tab in PDF Expert, or activate PDF Expert via LaunchBar, it seems to fail. But if I first click on the page I want to link to, AFAIK it always works.

GUI scripting is a pain. If there’s any combination of keystrokes that would move the focus to the page area of the current PDF, maybe we could add that to the script.

---

<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: [May 3, 2020, 7:40pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/13 "2020-05-03T19:40:57Z")

</div>

welcome to the Hook Productivity Forum, @chazzo

> [@chazzo](#):
>
> GUI scripting is a pain.

Agreed. Still, we’ll have another look at that UI scripting, but we can’t commit to this working.

We haven’t had a specific commitment yet from Readdle that they will provide the [bit of automation required for linking.](https://hookproductivity.com/help/integration/) They would need to be the ones to speak to their automation plans if any, of course. Fingers crossed.

As it stands, however, as you’ve found, PDF expert is currently not a reliable context in which to link PDF documents to one’s digital life.

Several other PDF apps support automation (e.g., PDFPenPro, Skim and Preview).

Even aside from Hook, I have been using and recommending Smile Software’s PDFPenPro for years (e.g., at CogZest). [PDFPenPro has OCR](https://smilesoftware.com/pdfpen/ocr/) and form creation for those who need it. Their customer support is excellent. (I’m certainly not saying competitors’ isn’t.) PDFPen development is quite active. Version 12 was recently released (I’m already using it, Pro version).

This isn’t the forum to do product comparisons. However, for customers who value automation and its features, PDFPenPro is worth considering.

---

<div class="post-metadata">

### Author: ![chazzo](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/chazzo/32/828_2.png) [@chazzo](https://discourse.hookproductivity.com/u/chazzo)
#### Post date: [May 3, 2020, 8:04pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/14 "2020-05-03T20:04:59Z")

</div>

Thanks for the pointer to the Integration page. I’ve been using Hook on and off for a while now, but have only just started to look seriously at what it can do.

Ironically I’ve just moved to PDF Expert from PDFPen 6. I’d previously used the Pro version and agree that the OCR works well – plus of course full scriptability 🙂

---

<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: [August 11, 2020, 1:16am UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/15 "2020-08-11T01:16:33Z")

</div>

> [@NickSloan](#):
>
> Notability thread

Looking back at this topic and the one it links to, I couldn’t quickly see that it was mentioned that [Gingerlab’s Notability](https://www.gingerlabs.com/) app does _not_ support automation or expose “Copy URL/link” in the UI. I’ve contacted Gingerlab’s support a couple of times; only canned email responses so far but hopefully they will look into it. I’ve added a note on our [Linkable apps](https://hookproductivity.com/what-mac-apps-are-compatible-with-hook-app) page to the effect that Notability app’s items are _not_ linkable. We’ve had a couple of customers ask about this recently, which is why I’m updating this topic.

On the positive side, a large number of note taking apps support automated linking; and we may be, I believe, entering a stage where remaining Mac app and SaaS developers will come to understand the importance of hyperlinking in this no longer new century. A chapter authored by myself and @danieljomphe in [_The Future of Text_](https://futuretextpublishing.com/) book ; the chapter is a manifesto on linking automation and user interfaces. I’ll later post a topic on the forum and a new webpage before the book is published, inviting co-signatories.

---

<div class="post-metadata">

### Author: ![RobTrew](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/robtrew/32/212_2.png) [@RobTrew](https://discourse.hookproductivity.com/u/RobTrew)
#### Post date: [August 12, 2020, 8:25pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/16 "2020-08-12T20:25:34Z")

</div>

> [@LucB](#):
>
> Gingerlab’s Notability

If Catalyst and apps imported from iOS generally become a bigger part of the ecosystem, scope for reliance on AppleScript glue will inevitably start to shrink. I don’t know if you have other options for getting through that bottle-neck.

---

<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: [August 12, 2020, 8:35pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/18 "2020-08-12T20:35:25Z")

</div>

I don’t think the barriers are technical (even with iOS). What we need is a commitment from developers to support UI and automated linking. This in turn hinges on market demand. Hook is part of the process to educe consciousness of the previously relatively hidden (tacit or implied) need for this. The manifesto soon to be published in The Future of Text, and we’ll offer in another form online soon inviting signatories, makes it clear that we are not calling for specific API’s (that would not be realistic), but general requirements (for UI and APIs) that automators and apps like Hook can leverage. E.g., we are not saying something like “implement xpath for deep linking” – that would not be realistic; just provide some automated support for deep linking (e.g., in the case of PDFs, to get page number and x,y of selection).

(2020-08-12 13:39: somehow my previous attempt to edit my reply turned into a separate reply. So I deleted the first version of my reply).

---

<div class="post-metadata">

### Author: ![holobiome](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/h/85f322/32.png) [@holobiome](https://discourse.hookproductivity.com/u/holobiome)
#### Post date: [March 4, 2021, 10:14pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/19 "2021-03-04T22:14:23Z")

</div>

Is there any update on PDF Expert integration?  
Failing that could I have help on pointing me in the direction for information about the steps involved in implementing the script that was provided at the start of this thread.  
Thanks.

---

<div class="post-metadata">

### Author: ![stevelw](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@stevelw](https://discourse.hookproductivity.com/u/stevelw)
#### Post date: [March 4, 2021, 11:32pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/20 "2021-03-04T23:32:55Z")

</div>

> **[Scripts Tab](https://hookproductivity.com/help/preferences/script-editor/)**
>
> This document first provides the background to Hook's Script editor. Then it describes the Script Editor itself.
> 
> The Scripts tab contains scripts that control how Hook interacts with your favorite apps, linking them together.
> 
> The Scripts tab is a...

---

<div class="post-metadata">

### Author: ![bear\_f](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/b/db5fbb/32.png) [@bear\_f](https://discourse.hookproductivity.com/u/bear_f)
#### Post date: [March 19, 2021, 5:14pm UTC](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457/21 "2021-03-19T17:14:32Z")

</div>

PDF Expert scripts provided on these forums work for me, unless it’s in full screen.

[Next page](https://discourse.hookproductivity.com/t/pdf-expert-integration-scripts/457.md?page=2)
