Using Hook with Calibre for creating a hook to a book

You have to add two shortcuts to Calibre for this to work.
In Calibre open Preferences and then open Shortcuts.
In the “Search for a shortcut by name” write copy and press enter.
For “Copy metadata” create a shortcut: Option + C
And for “Copy URL to show book in calibre” create a shortcut: Command + C

The Calibre scripts for Hook

Get Name:


set the clipboard to ""
tell application "System Events"
	repeat 10 times
		keystroke "c" using {option down}
		delay 0.1
		set t to (the clipboard as text)
		if t is not missing value and t is not equal to "" then
			exit repeat
		end if
	end repeat
end tell

set title to paragraph 1 of t
set author to paragraph 3 of t
set text item delimiters to {": "}
return text item 2 of title & " by " & text item 2 of author

Get Address:


set the clipboard to ""
tell application "System Events"
    repeat 10 times
     	keystroke "c" using {command down}
        delay 0.1
        set t to (the clipboard as text)
        if t is not missing value and t is not equal to "" then
            exit repeat
        end if
    end repeat
end tell


return t
1 Like

@Patrik Very nice! Works beautifully.

@kithairon Glad to hear :+1:

Excellent. Thank you.

@tonywatkins You’re more than welcome.

If you’re not familiar with deep links in calibre, I wrote how to use them in here: Does the Calibre ebook app have automation for linking e-books (deep or whole)? - #17 by Patrik

The procedure however does not involve Hook. If you, or anyone, has an idea how Hook could or should be used, let me know.

Yes, I briefly mentioned that in the other Calibre thread a while ago, but you gave a good explanation of them yesterday. I’m not using them in practice as most of my stuff own Calibre is PDFs, which I prefer to access and deep-link to in other ways – I’m not a fan of the ebook reader in Calibre.

Ok. Your comment reminded me of an app called Polar https://getpolarized.io/ . I used the version 1 a bit but don’t know what the version 2 is like.

1 Like

**Thanks for this @Patrick ! We’ve added this support accordingly in Hook scripts 160.

1 Like

It doesn’t work for me or I don’t know how to use it :frowning:

I had been failing to make Calibre work with Hook after reinstalling my OS. I’d completely forgotten about these two shortcuts despite commenting above!

It didn’t work for me after I’d put the shortcuts in, but when I checked the Calibre preferences again they hadn’t saved. I set them again and it now works.

(Note that you have to click ‘Done’ for each shortcut AND the ‘Apply’ button at the bottom.)