Microblog

2024/11/01

Faster&Easier Note Creation in Obsidian with AutoHotKey

Speeding up Daily Note Creation via Bash, PowerShell, and AHK

To streamline note-taking in my Obsidian vault, I created a script to automate new Markdown file creation in the Daily Notes folder, with the current date and time, and assigned it a keyboard shortcut using Obsidian's URI. I prototyped the script in both Bash (via WSL) and PowerShell. However, Windows introduced delay issues with keyboard shortcuts defined in shortcuts, which made the automation less efficient. A reliable workaround was to use AutoHotKey, setting up the script in the Startup folder. This approach bypassed the delay, allowing instant note creation with a simple Ctrl+Alt+N.

^!n:: ; Ctrl + Alt + N
Run, "C:\path\Obsidian.exe" "obsidian://new?vault=VAULT-NAME-HERE&name=Note-%A_YYYY%-%A_MM%-%A_DD%-%A_Hour%-%A_Min%"
return

To add this to startup, open Run with WIN+R and type shell:startup.