Automatically catalog all recent files in Obsidian
Based on Productivity Guru's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Verify Ruby is installed by running `ruby -v` before attempting to execute the script.
Briefing
A lightweight Ruby script can automatically generate a “recent” catalog inside Obsidian by listing every file created or last updated within the past seven days—similar in spirit to Obsidian’s research-style daily-note timeline. The payoff is practical: instead of manually hunting through notes, users get a rolling index they can consult to see what changed recently, and they can optionally turn each entry into a clickable link that jumps straight to the relevant daily note.
Getting it running starts with two prerequisites: Ruby must be installed (verified by running `ruby -v` in a command prompt), and the script source must be downloaded from a GitHub repository as a ZIP file. After unzipping, the user opens `recent.rb` in a preferred editor and edits the `nodes_path` (named `nodes_path` in the transcript) to point to the Obsidian vault folder—specifically adding a Dropbox-based path ending with a trailing slash. That trailing slash matters; without it, the script won’t behave as expected.
Once configured, the script is executed from the folder containing `recent.rb` using `ruby recent.rb`. The output is a catalog file (shown as “recent file changed” in the transcript) that enumerates all notes whose timestamps fall within the last week, capturing both newly created files and files that were modified.
The script also supports customization of how results are presented. One improvement described is adding clickable headers that link to the daily note for each date. This is done by editing the line that formats the file name in the output (around line 24), inserting Obsidian-style wiki links using double square brackets around the date/file header. After saving the change and rerunning the script, the generated catalog entries become navigable—clicking them takes the user to the corresponding daily note.
Beyond the working baseline, the transcript shifts to two planned enhancements. First, the user wants to change the date format used in the catalog; attempts to modify the `strftime` option reportedly caused errors, suggesting the formatting logic is sensitive. Second—and more consequential—the user wants the script to append the list of recently changed files directly into the original daily notes file. The goal is to make the recent activity immediately visible in each day’s note, so it can be surfaced via Obsidian’s backlinks pane across related notes.
In short: the script provides an automated weekly “what changed” index for Obsidian, with an optional clickable-link interface to daily notes. The remaining work is tailoring date formatting and integrating the recent list into daily notes automatically for smoother cross-referencing through backlinks.
Cornell Notes
A Ruby script can automatically build a “recent” catalog for an Obsidian vault, listing every file created or last updated in the past 7 days. After confirming Ruby is installed (`ruby -v`), users download `recent.rb`, set `nodes_path` to the vault location (including a trailing slash), and run `ruby recent.rb` from the script’s folder. The catalog can be enhanced with clickable headers by adding Obsidian-style wiki links (`[[...]]`) around the date/file header, letting users jump to the corresponding daily note. Future customization goals include changing the date format (attempts via `strftime` caused errors) and appending the recent list into each day’s original daily note so backlinks can surface the activity.
What are the minimum steps needed to generate a weekly “recent files” catalog in Obsidian?
Why does the `nodes_path` setting require a trailing slash?
How can the catalog entries be made clickable so they jump to daily notes?
What customization attempts are mentioned, and what went wrong?
What is the desired “next feature” beyond a standalone catalog file?
Review Questions
- What two conditions must be satisfied before running `recent.rb`, and how do you verify them?
- How do you modify the script so that date headers become clickable links to daily notes?
- What two future enhancements are proposed, and which one is currently blocked by errors?
Key Points
- 1
Verify Ruby is installed by running `ruby -v` before attempting to execute the script.
- 2
Download and unzip `recent.rb` from the referenced GitHub repository, then edit it in a text editor.
- 3
Set `nodes_path` to the Obsidian vault directory and include a trailing slash; missing it breaks expected behavior.
- 4
Run the script with `ruby recent.rb` from the folder containing the file to generate the weekly recent-files catalog.
- 5
Add clickable headers by wrapping the header placeholder with Obsidian wiki-link syntax `[[...]]` in the formatting line.
- 6
Planned improvements include changing the date format (currently error-prone when editing `strftime`) and appending recent entries into daily notes for backlink-friendly navigation.