How to use Linear with Hook

I use Hook for all kinds of things. Together with Alfred, Keyboard Maestro, and Drafts, it’s one of my most-used apps. Unfortunately, Hook doesn’t support Linear out of the box. Fortunately, Hook is extendable!

Here’s what I did to enable Hook in Linear.

tell application "Linear"
    tell application "System Events"
        key code 43 using {command down, shift down}
        delay 0.1
        set address to the clipboard

        key code 47 using {command down}
        delay 0.1
        set issue_name to the clipboard

        return "[" & issue_name & "](" & address & ")"
    end tell
end tell

I use two of Linear’s keyboard shortcuts.

  • Cmd + Shift + , to copy the URL of the issue.
  • Cmd + . to copy the name of the issue.

They are formatted as a markdown link and saved into Hook’s register. 🎉 Now Hook can connect Linear issues with Stack Overflow, Github, internet links, etc.

Side note: I use Choosy to open Linear’s electron app (instead of my browser) whenever I try to open a Linear URL.