Observations about Hook with PDFpenPro

My understanding is that multiple hooks in the Hook Search app would not work for the same PDF but multiple links/bookmarks to different pages in the same PDF either do work or shortly will work. Am I mistaken?

I hope you’re not mistaken but that I am.

Update: I got a Drafts draft with Markdown links to 2 spots in a PDF working - via Hook. So you’re right. (I might well automate some of this - once I truly get the hang of Hook.)

cf. Hook integration scripts v.147 now available — Updates for Notes, Drafts, Bear, PDFpenPro - Releases - Hook Productivity Forum

3 Likes

That works really well

Many thanks!

Happy new year to all

2 Likes

I looked at the URLs generated (in Drafts) and I see the page number encoded in plain text and it got me thinking…

… Is there a downside to confecting URLs to specific pages using that? My process would be to generate a Proper hook URL to Page 1 of a PDF in PDFPenPro and then hack the URL for any other page number my code identified?

That way I could connect a Drafts draft with a (h4) section for each section of a PDF, with a hookmark to that section’s first page. All programmatically.

I purchased an Upgrade to PDFPen Pro 12 because of an email from Hook announcing a linking to a specific section of a PDF. Thus far, after upgrading both Hook & PDFPenPro12, the only link I can get is to the Filename in the Finder?

Am I missing any steps to actually getting a “DeepLink”?

Welcome to the Hook Productivity Forum , @pchand, and thanks for asking.

To get a deep link, you need to select some text in the PDF. cf: Hook 2.2 Release Notes – Hook . The name of the link is the filename, not the selection. (We might change that to be filename/selection. But please keep in mind that in the context of the Hook window, hook updates the names of bookmarks to files when it detects that those names are changed in Finder. Obviously, the pasted link names won’t be updated).

Luc,

First of all, Happy New Year and thank you for such a rapid response on a Weekend day from the West Coast (I live in Kitchener-Waterloo, ON).

The Hook Link only takes me to :
a) The Filename of the PDF in the Finder.

This occurs whether I paste the Link (derived from a Command Shift Space or using the Contextual Menu Bar approach) in

a) a To-Do App,
b) TextEdit,
c) or leave it in Hook’s Bookmarks.

The File itself does not open with an activation of the link nor does the PDF inside PDFPenPro12 scroll to the Deeplink site EVEN if the file is already open inside PDFPenPro12 and the application is running / at the forefront with no other apps running.

As a Medical Doctor, it would be super useful for me to create a Database of Hyperlinks to existing PDFs of Medical Articles, Billing Code Books, Chapters/Sections of Current Reading Materials, etc.

It is unimportant how the UI inside Hook is accessed as long as the actual link to the PDF is to a specific location.
Bidirectionality of the link is also unimportant in many of these cases.

This would be my case-use for Hook that currently is only available in a limited way inside applications like EverNote, DevonThinkPro, Curio, and perhaps TinderBox.

Respectfully,
Pankaj Chand

That is precisely my use case as well - and it works extremely well for that purpose.

Are you actually highlighting some words when you create the link? That is necessary- you cannot simply put the cursor somewhere in the PDF but rather you have to highlight some text before you create the link.

Hi Richard,

I tried it again after your email and the result is still the same.
I was aware that I needed to highlight a piece of text (works similarly in Gmail as well as many other linking applications). Clicking on the Link where I paste it only highlights the filename in the Finder directory where the file is located without opening the file, scrolling to the section.

Do you think it may have something to do with other Applications running in the background preventing Hook or PDFPenPro12 from receiving the Invocation?

I am jealous that you have this working as it would be a huge boon for me to deconstruct sections of Kindle books, other PDFs, and make my own X-linked database from Pictorial Links (MindMapping) like the hyperlinkable body parts on this website: https://www.wheelessonline.com/

I am hoping to create my own Information Infographic Mindmap on my own Domain with Crosslinks to everything using Cloud URLs, local filelinks with Hook, EverNote and DevonThinkPro links, etc.

Pankaj

I should mention, I am still running Mojave 10.14.6 and older versions of EverNote 7.14 as I found updating many of these problematic as my ScanSnap software wasn’t updated with Catalina and therefore the perpetual nuisance of working things breaking down meant I spent more time fixing my broken computer software links than actually being productive.

Pankaj

It’s been tested on that OS too… could you please copy/paste here (Or send via PM) a specific URL that is supposed to be deep but isn’t working, as well as the name of the file you are linking to, and the page number linked to?

How do you have the middle preference set in Hook?

image

BTW - once you get this working (and I am sure you will) you might want to try something similar to this which I set up this week - do you use Keyboard Maestro?

1 Like

THANK YOU Richard and Luc. Problem SOLVED. I had the middle checkbox still checked (I guess it is the default setting and I did not change it as prior to now, the game-changing feature of locating a point inside a PDF did not exist until recently with Hook 2.2 and above).

You are both SuperStars!

I do have Keyboard Maestro but not particularly versed in its’ use / syntax and have even less knowledge of writing in AppleScript, Automator, etc.
I consequently have used Hazel, Super Shortcuts and the like in lieu of trying to learn programming.

Just last week, I started using Keyboard Maestro version 9.1 to create the following Indexing Strtaegy for all my PDFs inside EverNote which allows me to create both Local and Shareable WebLinks to PDFs parked inside a Desktop Copy of EverNote. I am trying to use the Index it creates to be able to use either MacOS or iOS to retrieve any PDF even if the Folder location moves inside EverNote:

Here is a screenshot. I would welcome ideas on writing better Scripts.
image.png

I also use Typinator, TypeIt4Me, and Textexpander but am strill struggling with making it all work in a simplified way. Maybe I have too many tools and ADHD!
I also have LiquidText and MarginNote 3 but have not learned how to use them yet.

feel free to explore these tools as they are all assistive Brain technologies for my aging brain.

Respectfully,
Pankaj

2 Likes

My suggestion would be to fully replace Evernote with DT3 and Tinderbox :slight_smile:

That of course is quite a topic for discussion by itself

Right. The clue, I think, is the Hook URI ends with “page=nnn” if it’s a reference to a spot in the PDF. (At least that’s what my experimenting got me last week.)

(I also think the URI contains coordinates on the page - but I’m less worried about that.)

Yes, the coordinates are page number and on page. We’ll add info about that in customer documentation.

Our URL format is meant to allow users to switch from one PDF app to another (that supports deep linking in this manner), like what we do for email, as these coordinates are per the PDF spec (as email IDs are from RFC5322).

1 Like

Thanks for confirming this.

I acknowledge knowing when to surface an API is tricky: If you think it might change you should be wary. On the other hand if it’s stable encouraging people to rely on it is helpful in creating ecosystem.

It’s good that the intent is to help multiple PDF handling programs - by publishing the API. (The one I’m working on - automatically generating links to pages based on searches for specific text at a specific font size - isn’t and won’t be commercial but I’ll tag along for the ride.) :slight_smile:

I also like that the API is general enough to permit all sorts of integrations.

Hi everyone,

I’ve got a problem with deep linking from PDFpenPro (and Skim, as well).
If I set up a deep link from PDFpenPro, the link is made correctly, i.e. it directs to a page and coordinates. If I open this link via Skim, it jumps to the right position.
But if I try to open the link by PDFpenPro, it always jumps to the start of the right page, (but) not to the right coordinates.

In addition: If I set up the link from Skim, the coordinates are missing, so all PDF programs can only jump to the start of the right page.

see example below

“[annurev-2Epolisci-2E10-2E072805-2E103054.pdf] (hook://file/ycE4BRMLd?p=RnVIL1Nob3J0IFJlcG9ydA==&n=annurev-2Epolisci-2E10-2E072805-2E103054.pdf#p=3&x=0&y=0&s=1082&e=1091)”

(split the link, so you can see it)

As a work around, I set Skim as my main PDF reader and manually invoke PDFpenPro to make deep links, but that’s a little bit cumbersome, since I have always to remember to choose “open with” and I would prefer to use only one PDF app (ok, in reality I’m using preview and pdf expert as well…) at the same time.

Do you have any ideas, what causes this unexpected behaviour?
Many thanks in advance!

Mac OS 10.14.6, Hook 3.1, PDFpenPro 12.2.2, Skim 1.6.3. (133)