Copy Link

  1. Home
  2. Docs
  3. Help & Support
  4. Hook Window
  5. Copy Link

The “Copy Link” command copies a link to the current document or resource. “Current” means the document or resource which is selected or open in the frontmost active window.

Different types of resources produce different types of addresses. Websites and pages will produce familiar http(s):// addresses (“URLs”).

When an application has a custom address “scheme”, Hook uses that. So if you invoke Hook in OmniFocus, for example, “Copy Link” will produce an address with the scheme, “omnifocus://”. Those links can be pasted and opened anywhere without Hook being involved as a proxy. Many other apps have custom schemes (e.g., bear:// , drafts5:// , evernote:// , ulysses://, bookends:// , addressbook:// , and things:///). Hook should always return the custom scheme if it can.

hook:// addressing schemes

In some cases, Hook will produce addresses with its own “scheme”, i.e. “hook://” followed by a “sub-scheme”, meaning hook://<sub-scheme>/<identifier>. The “sub-scheme” portion of the address corresponds to the application or type of resource that is being addressed: email, file and potential other types of information.

For example, links to emails look have the form, hook://email/<identifer> and files are hook://file/identifier. This allows you to refer to email messages uniformly regardless of the particular app in which you copy the link (e.g., Apple Mail, MailMate or AirMail). It also means that you can send hook://email links to other people and they can open the email by clicking on the link, regardless of their email client, so long as they are using Hook and they have a copy of the same email. This is because every email has a unique identifier (as defined by an “RFC”). (Microsoft Outlook however does not respect this. So in that case, Hook reverts to Microsoft’s custom email addressing. Also currently Spark email client does not programmatically expose the information required for users to do this. However, Hook covers the vast majority of email cases.)

Similarly, Hook also defines a “file” sub-scheme: hook://file. When you click those links, Hook acts as a proxy and finds them. Hook uses sophisticated mechanisms that enable its hook://file links to be robust even if you rename the file or move it around. In fact, you can even unmount the file system, version control system repository, or cloud storage folder in which a file resides, and remount it later, and Hook can typically resolve the hook://file link. And you can also email hook://file links to other people.

Advanced information about clipboard

“Copy Link” writes both a plain text and rich text (rtf) link to the clipboard. The rich text link is a hyperlink and the plain text link is just the URL.

macOS will paste the format which matches the text field, so if you paste into the subject of an email in Mail.app it will paste plain text, and if you paste into the body it will paste rich text.

For example, if you invoke Hook on this web page and use its “Copy Link” command on it, Hook will put the following in the clipboard:

  1. https://hookproductivity.com/help/hook-window/copy-as-link as a plain address (URL),
  2. Copy Link – Hook, that is: a formatted link which includes the name of the resource (meaning, of this web page, “Copy Link – Hook”), and its address https://hookproductivity.com/help/hook-window/copy-as-link, and
  3. custom link information.

So, if you then

  1. open a plain text editor (like TextEdit in plain text mode; or BBEdit) and use its paste command, you will get the first option,
  2. if open a rich text editor (like TextEdit in RTF mode, or Pages) and use its paste command, you will get the second option (a formatted link),
  3. if you invoke Hook on another resource, like an email, and then use “Link to Copied Address”, Hook will use the third version (though Hook can also work with the others).

Troubleshooting

If you are using a clipboard manager, you might want to add Hook to its exclude list. (See this topic.)

Was this article helpful to you? Yes No

How can we help?