skip to content

Daily Note with Obsidian and Raycast

/ 4 min read

What if I could have a keyboard shortcut that would open my daily note? One click, and I would be ready to start writing.

🖱️ Daily Note Keyboard Button with Obsidian

👋🏻 Introduction

I used to have a text-editor open all the time, where I’ll dump all my everyday notes and snippets. It will quickly grow to a large document, and then it’s hard to find anything. I tried to change my habits several times, but I always ended up opening TextMate or CodeRunner or my goto-editor and paste’n’forget - because it was SO easy.

But then I had an epiphany.

What if I could have a keyboard shortcut that would open my daily note? One click, and I would be ready to start writing. No more searching through a cluttered document, no more forgetting what I was working on.

So I did it. I dedicated an entire button on my keyboard to my daily note! Now, whenever I have something to write down, I just press that button and I’m ready to go.

Video Jiff of my one key daily note

🧩 How it works

I use a tool called Raycast to create a keyboard shortcut that opens my daily note. Raycast is a productivity app that lets you create custom commands for your Mac.

The script I created is simple: it just opens a new Obsidian note and sets the title to the current date. Here’s the code for the script (quickdump.sh):

#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title "dump"
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🤖

# Documentation:
# @raycast.description "QuickDump Daily Note"
# @raycast.author danielbahl
# @raycast.authorURL https://raycast.com/danielbahl

# Get current Year and Month
current_year=$(date +%Y)
current_month=$(date +%m)

# Define the base directory
base_dir=~/Library/CloudStorage/Dropbox/Notes/Dump
obsidian_vault=Notes

# Create new directories
mkdir -p ${base_dir}/${current_year}/${current_month}

# Create daily note (if not already created)
touch ${base_dir}/${current_year}/${current_month}/$(date +%F).md

# Open Obsidian 
open "obsidian://open?vault=${obsidian_vault}&file=%2F${current_year}%2F${current_month}%2F$(date +%F)"
# https://help.obsidian.md/Concepts/Obsidian+URI#Use+x-callback-url+parameters

Here is a breakdown of the script:

  • The first two lines are required parameters for the Raycast app. They specify the schema version, title, and mode of the command.
  • The next two lines are optional parameters. They specify the icon and description of the command.
  • The next three lines get the current year and month.
  • The next line defines the base directory where the daily notes will be stored.
  • The next line creates the directories for the current year and month, if they don’t already exist. The ${current_year} and ${current_month} variables are the current year and month.
  • The next line creates a new daily note file (if the file not exists) in the current year and month directory. The $(date +%F) function returns the current date in the format YYYY-MM-DD. so the file name is the current date in the format YYYY-MM-DD.md.
  • The last line opens Obsidian and opens the newly created daily note file.

The ${base_dir} variable is the path to the directory where my daily notes are stored. You need to change this to the base_dir of your Obsidian Vault. The ${obsidian_vault} variable is the Name or the ID of your Obsidian Vault. If you have a more complex name than mine (Notes) you can use the Vault ID as well.

The open command tells macOS to open the specified file or application. The -a flag tells macOS to open the file in the specified application. In this case, we’re opening the file in Obsidian, but you could easily change the app to open, for example if you are using Typora, the command will look something like this:

open -a typora ${base_dir}/${current_year}/${current_month}/$(date +%F).md

Now, when I press the keyboard shortcut, Raycast runs this command, which opens a new Obsidian note and sets the title to the current date.

🧑🏻‍🏫 Install the script in Raycast

Save the script file somewhere on your computer, and then open Raycast Settings -> Extensions -> + -> Add Script Directory:

Add Script Directory to Raycast

After added with directory with your scripts, you can assing a hotkey to the script.

Screenshot of Raycast Script Settings

I have a GMMK2 Glorious Keyboard where I mapped on the quick-shortcut sidebuttons to CMD+SHIFT+F4 and now with a press of this single note-button, I have my daily note:

Obsidian with my Daily note

🧠 Why it works

This workflow works because it’s simple and efficient. It only takes one click to open my daily note, paste or write something, and done. And the note is always organized in a way that makes sense.

I’ve been using this workflow for a few months now, and it’s been a game-changer. I’m much more productive now that I have a dedicated place to write down my thoughts and ideas.

If you’re looking for a way to improve your productivity, I highly recommend giving this workflow a try. It’s simple, but it works.

💛 Conclusion

I hope this post has inspired you to create your own daily note keyboard shortcut. It’s a small change that can make a big difference in your productivity.

Thanks for reading!