tags: automation, tools, obsidian, 24 Sep 2023
TL;DR: All instructions and code for setting up this system can also be found in this Github repository.
In this writeup, I’ll share insights into my Obsidian setup, focusing on the seamless organization of daily, weekly, and meeting notes. It can also be found on Medium
- About Obsidian
- Note Organization
- The Current Setup
- The Challenge
- Proposed Solutions
- The Setup
0) Required/Used Plugins 1) Install calendar and periodic notes
2) Create shortcut to new notes
3) Get a prompt to enter a meeting note
4) Prefix the name with the date of the daily note by creating a Macro in QuickAdd
5) List all relevant notes for the day or week with Dataview - The Result
About Obsidian
Obsidian is an excellent note-taking app, accommodating both simple and extensive note-taking needs. With support for Markdown, linking, metadata, tables, and a wide range of community-built plugins (vim-mode ftw), it’s a versatile tool.
Note Organization
One key aspect to master when using Obsidian is how to structure your notes. Should you organize them by subject, cause, date, in folders, sub-folders, or nested sub-sub-sub-folders? Without a solid organizational strategy, you’ll end up relying heavily on search, which, while functional, isn’t ideal for day-to-day use. In my setup, I sought an organization method that would keep my notes tidy and require minimal upkeep.
The Current Setup
In my current setup, I categorize my notes into three distinct types: subject notes, captured notes (from the web, using Fleeting Notes), and daily notes. Subject notes are long-lived, frequently updated, and serve as references. Some of them are organized into subject-specific folders or sub-folders. Captured notes are designed to store web-based information I stumble upon, preventing me from cluttering my Todoist with URLs (“to read them later”). Daily notes, generated by clicking a date in the Calendar, provide dedicated spaces for daily or weekly entries.
The Challenge
While this setup works well in general, there’s a specific aspect that needs improvement. The subject notes perform admirably, although they may not always be perfect from the outset. These notes tend to self-improve over time, benefiting from regular visits and updates. The captured notes serve their intended purpose adequately, and while there might be room for enhancement in the future, they currently meet my needs. However, the daily/weekly notes pose a challenge. Despite using templates, tags, and linking, they remain too unstructured for my liking. The primary issue is that all my daily notes, including scribbles and various meeting notes, end up in a single file.
Proposed Solutions
Attempt 1
A solution would be to create a completely separate note type, just for meetings. These meeting notes are different from daily notes as they are short(er), because they are only focussed on one meeting, and usually just relevant before, during, and (short) after the meetings. They can be used to prepare for the meeting, take notes during, and read about the things I wrote down later, such as next steps, conclusions, etc. Conceptually, adding this extra type is not very hard, but storing these notes in an organised way is something else. You would always need to use the same name convention or use the exact right folder (which could be different every time). This would be time-consuming and cost too much effort.
In order to fix this, I hoped to find a plugin that would get all my Google calendar events into Obsidian such that I could easily create notes from these. Several Google calendar plugins that enable that do exist (1, 2) but after trying them, I found out that they didn’t fit my needs.
- They require you to loosen security measures in your Google account (by enabling public links), or want you to set up, a private app (that would need to redirect via an external url if you want to use it on mobile).
- Do not allow for more than 1 calendar
- Give you all your calendar events, without the option to filter them (at least not on calendar-level, disabling delegates is an option)
Attempt 2
Given the constraints, I opted to manually create meeting notes, emphasizing the need for an efficient organizational approach. Here’s how it works:
- Utilize the daily note feature, as before.
- Create a shortcut to initiate new meeting notes (e.g., using Hotkeys or the command palette).
- Prompt for a meeting name when initiating a new note.
- Prefix the note’s name with the creation date from the daily note.
- List all notes for the day on the daily note and all weekly notes on the weekly note.
The Setup
0) Required/Used Plugins
You can install these already, or do so when they are mentioned in the steps below.
- Calendar
- Dataview
- Periodic Notes
- QuickAdd
1) Install Calendar + Periodic notes
To begin building this solution, install two plugins: The Calendar plugin and Periodic notes.
The Calendar plugin offers convenient access to all your daily and weekly notes. It achieves this by creating links to daily notes, effectively transforming each day into a direct link to its corresponding daily note. While it currently supports weekly notes as well, there’s a hint that these might eventually transition and work exclusively via Periodic notes.
The foundation of our setup relies on utilizing both plugins. By doing so and configuring the calendar for easy access to daily and weekly notes, you establish the groundwork for the entire solution.
2) Create shortcuts to new notes
To establish a convenient shortcut for creating new meeting notes, you essentially have two primary options within Obsidian.
1) Command Palette: The first option is to use the Command Palette, which is a core plugin of Obsidian. You can access the Command Palette by pressing “Cmd+P”. It provides a comprehensive list of all enabled actions within Obsidian. To transform an action into a genuine shortcut, you can pin it, allowing you to quickly access it with “Cmd+P” and execute it without searching each time.
2) Hotkeys: The second option involves using Hotkeys, another built-in feature in Obsidian. Hotkeys enable you to define a custom combination of keys to trigger a specific command. This method works exceptionally well for creating shortcuts. For example, I use “Cmd+Shift+N” to initiate the command that we’ll create in the next step.
In the subsequent step, we’ll craft the command you need for quickly generating new meeting notes.
3) Get a prompt to enter a meeting note
QuickAdd offers a versatile toolkit, allowing you to harness templates, macros, and captures, either individually or in combination. We’ll use this powerful tool to create the actual meeting notes seamlessly.
To begin, follow these steps:
1) Creating a Template: Start by crafting a template for your meeting notes, for example, let’s call it “✨ new daily meeting note.” Within this template, configure the settings to specify the note it should use as a reference. You can choose to leave this reference note empty or include content you wish to reuse in every new meeting note. In order to make the template accessible as a command later on, make sure you hit the ⚡️-icon in the QuickAdd overview.
2) Configuring QuickAdd Options: - Enable “Set file name format” and set it to:
{{MACRO:getFileName::start}}-{{NAME}}
We’ll delve into the significance of this setting shortly.
3) Enable “Create in folder” and designate the daily note folder as the destination. While you can also opt for the “Choose folder” option, it adds an extra step each time you create a note.
4) Customize your experience further by enabling options such as “Open,” “New split,” and “Focus new pane” according to your preferences.
This setup will introduce a new command, titled “✨ new daily meeting note,” accessible via the command palette. As mentioned earlier, you can pin this command for quick access, as outlined in the previous step. When you initiate this command, it opens a prompt, prompting you to input a name for your meeting note. This user input corresponds to “{{NAME}}” as defined in the file name format.
However, it’s important to note that at this stage, the command may encounter an error. This is because we haven’t yet created the necessary macro used in the file name format. We’ll address this in the upcoming steps.
4) Prefix the name with the date of the daily note by creating a Macro in QuickAdd
To resolve the issue, we’ll establish a macro within QuickAdd to handle file naming. Follow these steps:
- Access Macro Management: Navigate to QuickAdd’s macro management feature. To do this, click on “Manage macros” within the QuickAdd plugin.
- Define the Macro Name: In the macro management panel, designate a name for your macro. For this specific task, let’s name it “getFileName”.
- Configure the Macro: In the “Obsidian command” section of the macro, select “Copy file path.” This action will replicate the file path of the current file.
- Adding a JavaScript Script: To complete the macro’s functionality, you’ll need to incorporate a JavaScript script. This script necessitates the creation of a JavaScript file. Create a JavaScript file named “macro.js”. You can position this file in the root folder of your Obsidian vault or any other suitable location.
Populate “macro.js” with the following code. Note: you should do this in a (text)editor, not in Obsidian. The file should have the extension “.js”.
module.exports = {
start,
};
async function start(params) {
let filePath = await params.quickAddApi.utility.getClipboard();
var fileVars = filePath.split("/");
var fileName = fileVars.pop();
fileName = fileName.slice(0, -3);
return fileName;
}
This script defines a function named “start” that extracts the filename without the file extension from the clipboard.
- Linking the Script: Return to the QuickAdd macro management panel, and input the path to the
macro.js
JavaScript file in the designated input field next to “User script.”
With these steps completed, when you visit a daily note and execute your meeting-note-command, whether through Hotkeys or the command palette, you’ll still encounter the prompt for input. However, once the file is created, it should be automatically prefixed with the date of the daily note that was open at the moment when you initiated the file creation.
5) List all relevant notes for the day or week with Dataview
Now that you have the command for creating new notes in place, the next step is to ensure easy access to these notes without the need for extensive searching. This can be achieved using the powerful Dataview plugin, which allows you to query your notes in an SQL-like manner.
To List Notes Prefixed with Daily Date:
To display all notes prefixed with the date of the daily note you are currently viewing, incorporate the following code into your daily note template:
##### {{DATE}} notes:
```dataview
list
from "_second_brain/periodic/daily"
where file.day = this.file.day
sort file.ctime asc```
This code creates a section in your daily note, marked with the current date. It then utilizes Dataview to list all notes from the “_second_brain/periodic/daily” folder that share the same file.day
attribute as your current daily note. This list is sorted in ascending order based on file creation time.
To List Daily Notes for a Specific Week:
To list all daily notes for a given week, you can integrate the following code into your weekly note template:
##### {{DATE}} notes:
```dataview
list
from "_second_brain/periodic/daily"
where string(date(file.day).weekyear) = split(split(this.file.name, "-")[1], "W")[1]
and string(date(file.day).year) = split(this.file.name, "-")[0]```
This code generates a section in your weekly note, marked with the corresponding date. It leverages Dataview to list all daily notes from the “_second_brain/periodic/daily” folder that match the week and year extracted from your weekly note’s file name. This effectively compiles all daily notes for the specified week.
With these Dataview-based setups, you can conveniently navigate and access relevant notes associated with your daily and weekly activities, minimizing the need for extensive manual searching.
The Result
With this setup, creating organized meeting notes is a breeze. For instance, if you have a meeting “X” scheduled on date Y, in week Z, and want to make a note for that meeting:
- Navigate to the desired date Y in your calendar.
- Launch the meeting note command.
- Enter a name for your meeting note (e.g., “Meeting X”).
That’s it! You now have a note named “X-Y”, which is listed among your notes for the day and week.