Raycast script workflow for Hook

Hi guys.

Sharing here a script workflow for Raycast I made.

Who is this workflow for?

  • you use “Copy Markdown Link” almost exclusively
  • you use Hook’s global keyboard shortcuts
  • you paste the markdown link in your notes (Obsidian in my case) and want to link the copied markdown link to that note

Why did I make this workflow?

When using the global keyboard shortcuts, I found no visual feedback that I had either successfully “copied markdown link” or successfully “hooked to copied link”. Furthermore, the process for me became repetitive:

  1. copy markdown link
  2. switch to my note in Obsidian
  3. hook to copied link
  4. paste the copied markdown link

Ideally I wanted steps 3 & 4 combined. If I paste this link in this note, it makes sense in my head that they should automatically be hooked. This script does that.

How does the script work and what are the pre-requisites?

Using applescript, it just triggers the global keyboard shortcut for “Copy Markdown Link” and “Hook to copied link”. In Hook, these should be configured to hyper-m and hyper-v respectively. It then logs an output message. For paste-and-hook.applescript, it triggers a cmd + v keyboard shortcut after to paste the copied link.

I’ve set the scripts as favorites in Raycast where it’s an easy keyboard press away.

Here’s a gif:

If this interests you, you can download it here: GitHub - neldeles/hook-raycast then add the folder to Raycast.

You can inspect the source code as well to see how rudimentary the script really is. Hope it helps someone. :slight_smile:


Welcome to the Hook Productivity Forum, @neldeles . Thanks for sharing! Nice to see automation with Raycast. Hook also has an AppleScript dictionary : https://hookproductivity.com/help/automation/hooks-applescript-dictionary/ that can be leveraged.