Open Today's Note from anywhere on macOS with Keyboard Maestro or Alfred

This is a trivial macro to build, but just in case someone else hasn’t considered it, I thought I’d share it here.

If you’re on macOS, Keyboard Maestro is an incredibly powerful automation tool. This little macro simply uses the keyboard shortcut assigned to Today’s Note to open it in Obsidian, and will work even if you’re currently working anywhere else on the OS.

Here’s what it looks like:

Using Keyboard Maestro’s URL triggers, it’s pretty easy to activate the macro via e.g., Alfred or a Stream Deck button. You could also trigger it via KM’s other options, of course.


If you use Alfred, you can also do this without Keyboard Maestro. Create a workflow that upon triggering launches Obsidian, delays for a brief moment (I used .2s), and then dispatches the appropriate Open Today’s Note keypress.

See the workflow here.

14 Likes

It will be beautiful if you edit the post and share directly the extension :smile:

For some reason the Obsidian will open, but daily note will not. :man_shrugging:t3:
I ensured that shortcut for new note inside Obsidian is same like in Keyboard maestro (CMD+T) and manually pressing it it will open today’s note.

When obsidian is already open the daily note will open… is there any smart wait command between opening app to wait for app to open, and then press the key?

I use BetterTouchTool for this, with two assigned actions:

  • Launch Obsidian
  • Send shortcut to Obsidian
2 Likes

There is a Wait action in Keyboard Maestro. It isn’t smart, but sometimes I’ve had luck getting macros to run by inserting “Wait .3 seconds” or similar.

Im lucky with 3 seconds :scream:

1 Like

ha oh dear. Your processor needs to work out more or something! Is it 3s even if Obsidian’s already launched, just backgrounded?

1 Like

It is 3 seconds when lunched from scratch.

  • I have macbook 12’ so definitely not so fast machine.
1 Like

You could probably do something like:

If Obsidian is Open
    Launch Obsidian
    Wait .3 s
    Enter keystrokes for open today’s note
Else
    Launch Obsidian 
    Wait 3 s
    Enter keystrokes for open today’s note

Would be a little more fluid!

Correct! I was thinking to do that. Wait 3 seconds for nothing is luxury :slight_smile: It is pretty easy to implement in Keyboard meastro, Im just checking it. Thank you for your help!

1 Like

Have you tried the “Pause Until” action? This allows you to pause until a specific condition is met. One of which could be “Obsidian is running && at the front”.

I use AutoHotKey on Windows.

My hotkey for the daily note is STRG+T.

Use STRG+ALT+N to open the today’s note with the following script:

^!n::
if WinExist("ahk_exe Obsidian.exe")
	WinActivate
else {
	Run C:\Users\joe\AppData\Local\Obsidian\Obsidian.exe
	sleep, 1000 ; wait 1000/1000 seconds
}
Send ^t
return
1 Like

Thank you so much for the Alfred workflow. Very useful

Stumbled across this as well and found a less “hacky” method (no .2s waiting period), that works with Obsidian-URIs.

Those are the steps:

  1. Install the Advanced URI plugin
  2. Activate it
  3. Make a workflow with two parts:
    a) the trigger or keyword,
    b) action: open this link: obsidian://advanced-uri?vault=<your-vault>&daily=true

I installed & enabled the plugin. So, when I replace <your-vault> with Obsidian (which is the name of my vault) Keyboard Maestro says it doesn’t exist. Am I supposed to put the full folder path in there, since my daily notes are in a sub-folder; what would be the syntax for that? Because I tried Obsidian/Vault/Personal/Journal/ & it didn’t recognize that either.

Paste the whole string you’re using as the URL here?

obsidian://advanced-uri?vault=Obsidian/Vault/Personal/Journal/&daily=true

1 Like

Try this instead:

obsidian://advanced-uri?vault=Obsidian&daily=true
2 Likes

@ldebritto I tried that first & it didn’t work.

1 Like

There’s also this:

  1. Open command palette (Cmd+P on macOS)
  2. Search for the Advanced URI: copy URI for daily note command
  3. Paste that on your Keyborard Maestro Macro
2 Likes

@ldebritto That worked, thanks! :grin:

1 Like